again, in more places, fix bug when reading a zero-bit-long value

This commit is contained in:
Josh Coalson 2001-07-16 18:10:56 +00:00
parent 522f7d3f02
commit 6fd1c20da1

View File

@ -1077,11 +1077,6 @@ FLAC__bool FLAC__bitbuffer_read_raw_uint32(FLAC__BitBuffer *bb, FLAC__uint32 *va
FLAC__ASSERT(bits <= 32);
FLAC__ASSERT((bb->capacity*8) * 2 >= bits);
if(bits == 0) {
*val = 0;
return true;
}
while(bb->total_consumed_bits + bits > bb->total_bits) {
if(!bitbuffer_read_from_client_(bb, read_callback, client_data))
return false;
@ -1258,11 +1253,6 @@ FLAC__bool FLAC__bitbuffer_read_raw_uint64(FLAC__BitBuffer *bb, FLAC__uint64 *va
FLAC__ASSERT(bits <= 64);
FLAC__ASSERT((bb->capacity*8) * 2 >= bits);
if(bits == 0) {
*val = 0;
return true;
}
while(bb->total_consumed_bits + bits > bb->total_bits) {
if(!bitbuffer_read_from_client_(bb, read_callback, client_data))
return false;
@ -1316,11 +1306,6 @@ FLAC__bool FLAC__bitbuffer_read_raw_int64(FLAC__BitBuffer *bb, FLAC__int64 *val,
FLAC__ASSERT(bits <= 64);
if(bits == 0) {
*val = 0;
return true;
}
v = 0;
for(i = 0; i < bits; i++) {
if(!FLAC__bitbuffer_read_bit_to_uint64(bb, &v, read_callback, client_data))
@ -1349,11 +1334,6 @@ FLAC__bool FLAC__bitbuffer_read_raw_int64(FLAC__BitBuffer *bb, FLAC__int64 *val,
FLAC__ASSERT(bits <= 64);
FLAC__ASSERT((bb->capacity*8) * 2 >= bits);
if(bits == 0) {
*val = 0;
return true;
}
while(bb->total_consumed_bits + bits > bb->total_bits) {
if(!bitbuffer_read_from_client_(bb, read_callback, client_data))
return false;