diff --git a/Quake/miniz.c b/Quake/miniz.c index a9318862..1a180281 100644 --- a/Quake/miniz.c +++ b/Quake/miniz.c @@ -649,6 +649,12 @@ tinfl_status tinfl_decompress(tinfl_decompressor *r, const mz_uint8 *pIn_buf_nex 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) {