diff --git a/src/miniz.h b/src/miniz.h index 94afbd19..2f9ee3bd 100644 --- a/src/miniz.h +++ b/src/miniz.h @@ -4620,6 +4620,12 @@ tinfl_status tinfl_decompress(tinfl_decompressor *r, bit_buf >>= code_len; num_bits -= code_len; + /* assert(sym2 != 0 && counter != 0); */ + if (sym2 == 0 && counter == 0) + { + TINFL_CR_RETURN_FOREVER(40, TINFL_STATUS_FAILED); + } + pOut_buf_cur[0] = (mz_uint8)counter; if (sym2 & 256) { pOut_buf_cur++;