diff options
author | Erik de Castro Lopo <erikd@mega-nerd.com> | 2014-12-17 19:02:26 +1100 |
---|---|---|
committer | gitbuildkicker <android-build@google.com> | 2016-08-16 15:51:40 -0700 |
commit | 2ef9ce533a63ba0aa56e77b36d3577ce8e866936 (patch) | |
tree | 2ddb54dcfcee82e5afbd525972a1c796e386abf1 | |
parent | b499389da21d89d32deff500376c5ee4f8f0b04c (diff) | |
download | android_external_flac-2ef9ce533a63ba0aa56e77b36d3577ce8e866936.tar.gz android_external_flac-2ef9ce533a63ba0aa56e77b36d3577ce8e866936.tar.bz2 android_external_flac-2ef9ce533a63ba0aa56e77b36d3577ce8e866936.zip |
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/).
Bug: 27211885
Change-Id: Iad7ced634d417df475050c8f379e0e95ec36b115
-rw-r--r-- | libFLAC/stream_decoder.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/libFLAC/stream_decoder.c b/libFLAC/stream_decoder.c index 7dff737..601d86f 100644 --- a/libFLAC/stream_decoder.c +++ b/libFLAC/stream_decoder.c @@ -1754,8 +1754,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; |