From c17f2959d42952c7ef6b1678b18d9590c160aaae Mon Sep 17 00:00:00 2001 From: Roy Oursler Date: Wed, 24 Aug 2016 11:00:08 -0700 Subject: [PATCH] igzip: Fix bug read_header causing false error return values Change-Id: I7b2fc0d7fa1ea78fab6c8788618d3e48ece56cfd Signed-off-by: Roy Oursler --- igzip/igzip_inflate.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/igzip/igzip_inflate.c b/igzip/igzip_inflate.c index 8966100..4c9bfc5 100644 --- a/igzip/igzip_inflate.c +++ b/igzip/igzip_inflate.c @@ -634,12 +634,13 @@ static int inline setup_dynamic_header(struct inflate_state *state) if (code_count[i] != 0) break; } - if (i == 16) - return ISAL_INVALID_BLOCK; if (state->read_in_length < 0) return ISAL_END_INPUT; + if (i == 16) + return ISAL_INVALID_BLOCK; + make_inflate_huff_code_small(&inflate_code_huff, code_huff, CODE_LEN_CODES, code_count, CODE_LEN_CODES);