From 507026bca26a38d448a624776c596f722c672262 Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Sun, 6 Oct 2013 17:35:57 -0500 Subject: 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 --- lib/bunzip.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/bunzip.c b/lib/bunzip.c index fd40c147..23c25940 100644 --- a/lib/bunzip.c +++ b/lib/bunzip.c @@ -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; -- cgit v1.2.3