Fix CRC calculation for small blocks.

This commit is contained in:
Robert Kausch
2018-04-30 18:09:51 +02:00
committed by Erik de Castro Lopo
parent 8874ecc082
commit 65c2796402

View File

@@ -128,7 +128,7 @@ static inline void crc16_update_word_(FLAC__BitReader *br, brword word)
static inline void crc16_update_block_(FLAC__BitReader *br)
{
if(br->crc16_align)
if(br->consumed_words > br->crc16_offset && br->crc16_align)
crc16_update_word_(br, br->buffer[br->crc16_offset++]);
#if FLAC__BYTES_PER_WORD == 4