Index: src/delta.c
==================================================================
--- src/delta.c
+++ src/delta.c
@@ -438,11 +438,11 @@
         bestCnt = 0;
         break;
       }
 
       /* If we reach this point, it means no match is found so far */
-      if( base+i+NHASH>lenOut ){
+      if( base+i+NHASH>=lenOut ){
         /* We have reached the end of the file and have not found any
         ** matches.  Do an "insert" for everything that does not match */
         putInt(lenOut-base, &zDelta);
         *(zDelta++) = ':';
         memcpy(zDelta, &zOut[base], lenOut-base);