deflate_decompress: rename overrun_count to overread_count

Make it clear that this is for the input, not the output.

Update https://github.com/ebiggers/libdeflate/issues/157
This commit is contained in:
Eric Biggers 2022-01-14 21:35:32 -08:00
parent 572e4c5db0
commit 5be041247e
2 changed files with 5 additions and 5 deletions

View File

@ -43,7 +43,7 @@ FUNCNAME(struct libdeflate_decompressor * restrict d,
const u8 * const in_end = in_next + in_nbytes;
bitbuf_t bitbuf = 0;
unsigned bitsleft = 0;
size_t overrun_count = 0;
size_t overread_count = 0;
unsigned i;
unsigned is_final_block;
unsigned block_type;

View File

@ -222,7 +222,7 @@ do { \
if (likely(in_next != in_end)) \
bitbuf |= (bitbuf_t)*in_next++ << bitsleft; \
else \
overrun_count++; \
overread_count++; \
bitsleft += 8; \
} while (bitsleft <= BITBUF_NBITS - 8)
@ -307,9 +307,9 @@ if (!HAVE_BITS(n)) { \
*/
#define ALIGN_INPUT() \
do { \
SAFETY_CHECK(overrun_count <= (bitsleft >> 3)); \
in_next -= (bitsleft >> 3) - overrun_count; \
overrun_count = 0; \
SAFETY_CHECK(overread_count <= (bitsleft >> 3)); \
in_next -= (bitsleft >> 3) - overread_count; \
overread_count = 0; \
bitbuf = 0; \
bitsleft = 0; \
} while(0)