It's not a problem to exactly fill up the buffer with a run if the next symbol is...
authorRob Landley <rob@landley.net>
Sun, 6 Oct 2013 22:35:57 +0000 (17:35 -0500)
committerRob Landley <rob@landley.net>
Sun, 6 Oct 2013 22:35:57 +0000 (17:35 -0500)
lib/bunzip.c

index fd40c14..23c2594 100644 (file)
@@ -378,7 +378,7 @@ static int read_huffman_data(struct bunzip_data *bd, struct bwdata *bw)
        literal used is the one at the head of the mtfSymbol array.) */
     if (runPos) {
       runPos = 0;
-      if (dbufCount+hh >= bd->dbufSize) return RETVAL_DATA_ERROR;
+      if (dbufCount+hh > bd->dbufSize) return RETVAL_DATA_ERROR;
 
       uc = bd->symToByte[bd->mtfSymbol[0]];
       byteCount[uc] += hh;