From f932bc73cb67c1d61ffc76affe6e6d7145ecba05 Mon Sep 17 00:00:00 2001 From: Josh Coalson Date: Fri, 27 Apr 2001 03:38:31 +0000 Subject: [PATCH] fix bug in inlined version of ...read_unary...() --- src/libFLAC/bitbuffer.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/libFLAC/bitbuffer.c b/src/libFLAC/bitbuffer.c index 416b01b3..30dc655d 100644 --- a/src/libFLAC/bitbuffer.c +++ b/src/libFLAC/bitbuffer.c @@ -1425,7 +1425,7 @@ bool FLAC__bitbuffer_read_unary_unsigned(FLAC__BitBuffer *bb, unsigned *val, boo FLAC__CRC16_UPDATE(bb->buffer[bb->consumed_bytes], bb->read_crc16); bb->consumed_bytes++; bb->consumed_bits = 0; - /* we hold off updating bb->total_consumed_bits until the end */ + bb->total_consumed_bits += val_; } } while(1) { @@ -1447,7 +1447,7 @@ bool FLAC__bitbuffer_read_unary_unsigned(FLAC__BitBuffer *bb, unsigned *val, boo bb->consumed_bytes++; bb->consumed_bits = 0; } - bb->total_consumed_bits += (++val_); + bb->total_consumed_bits += i; return true; } else { @@ -1456,6 +1456,7 @@ bool FLAC__bitbuffer_read_unary_unsigned(FLAC__BitBuffer *bb, unsigned *val, boo bb->consumed_bytes++; /* bb->consumed_bits is already 0 */ /* we hold off updating bb->total_consumed_bits until the end */ + bb->total_consumed_bits += 8; } } }