mirror of
https://github.com/claunia/flac.git
synced 2025-12-16 18:54:26 +00:00
src/libFLAC/stream_decoder.c : Fix NULL de-reference.
NULL de-reference can really only happen on a malformed file. Found using afl (http://lcamtuf.coredump.cx/afl/).
This commit is contained in:
@@ -1753,8 +1753,10 @@ FLAC__bool read_metadata_vorbiscomment_(FLAC__StreamDecoder *decoder, FLAC__Stre
|
||||
}
|
||||
else
|
||||
length -= 4;
|
||||
if (!FLAC__bitreader_read_uint32_little_endian(decoder->private_->input, &obj->comments[i].length))
|
||||
if (!FLAC__bitreader_read_uint32_little_endian(decoder->private_->input, &obj->comments[i].length)) {
|
||||
obj->num_comments = i;
|
||||
return false; /* read_callback_ sets the state for us */
|
||||
}
|
||||
if (obj->comments[i].length > 0) {
|
||||
if (length < obj->comments[i].length) {
|
||||
obj->num_comments = i;
|
||||
|
||||
Reference in New Issue
Block a user