diff --git a/src/libFLAC/bitreader.c b/src/libFLAC/bitreader.c index 5e4b5918..3df4d02c 100644 --- a/src/libFLAC/bitreader.c +++ b/src/libFLAC/bitreader.c @@ -869,7 +869,7 @@ incomplete_lsbs: cwords = br->consumed_words; words = br->words; ucbits = FLAC__BITS_PER_WORD - br->consumed_bits; - b = br->buffer[cwords] << br->consumed_bits; + b = cwords < br->capacity ? br->buffer[cwords] << br->consumed_bits : 0; } while(cwords >= words && val < end); }