aboutsummaryrefslogtreecommitdiff
path: root/libFLAC/stream_decoder.c
diff options
context:
space:
mode:
Diffstat (limited to 'libFLAC/stream_decoder.c')
-rw-r--r--libFLAC/stream_decoder.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libFLAC/stream_decoder.c b/libFLAC/stream_decoder.c
index d364b0ce..071398ae 100644
--- a/libFLAC/stream_decoder.c
+++ b/libFLAC/stream_decoder.c
@@ -1632,6 +1632,8 @@ FLAC__bool read_metadata_streaminfo_(FLAC__StreamDecoder *decoder, FLAC__bool is
/* skip the rest of the block */
FLAC__ASSERT(used_bits % 8 == 0);
+ if (length < (used_bits / 8))
+ return false; /* read_callback_ sets the state for us */
length -= (used_bits / 8);
if(!FLAC__bitreader_skip_byte_block_aligned_no_crc(decoder->private_->input, length))
return false; /* read_callback_ sets the state for us */