It's not a problem to exactly fill up the buffer with a run if the next symbol is the terminating symbol. Fixes https://jira.cyanogenmod.org/browse/CYAN-1896

This commit is contained in:
Rob Landley 2013-10-06 17:35:57 -05:00
parent d277414eb6
commit 507026bca2

View 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;