summaryrefslogtreecommitdiffstats
path: root/libFLAC/stream_decoder.c
diff options
context:
space:
mode:
authorErik de Castro Lopo <erikd@mega-nerd.com>2015-08-20 19:31:08 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2015-08-20 19:31:08 +0000
commit4e2a8e33b7b741a19ff658bad8623541a759e44f (patch)
treee334131ed1ba88f348706c70896820dbec9efcb2 /libFLAC/stream_decoder.c
parent1059277158816446071671ac465bcfb91ca78256 (diff)
parent649952f919f79c0aaf294f9f0be61d983c52da74 (diff)
downloadandroid_external_flac-4e2a8e33b7b741a19ff658bad8623541a759e44f.tar.gz
android_external_flac-4e2a8e33b7b741a19ff658bad8623541a759e44f.tar.bz2
android_external_flac-4e2a8e33b7b741a19ff658bad8623541a759e44f.zip
am 649952f9: am 1e5f0b6c: am 1d948ef7: libFLAC/stream_decoder.c : Fail safely to avoid a heap overflow.
* commit '649952f919f79c0aaf294f9f0be61d983c52da74': libFLAC/stream_decoder.c : Fail safely to avoid a heap overflow.
Diffstat (limited to 'libFLAC/stream_decoder.c')
-rw-r--r--libFLAC/stream_decoder.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libFLAC/stream_decoder.c b/libFLAC/stream_decoder.c
index d13b23b..7edf735 100644
--- a/libFLAC/stream_decoder.c
+++ b/libFLAC/stream_decoder.c
@@ -2749,7 +2749,8 @@ FLAC__bool read_residual_partitioned_rice_(FLAC__StreamDecoder *decoder, unsigne
if(decoder->private_->frame.header.blocksize < predictor_order) {
send_error_to_client_(decoder, FLAC__STREAM_DECODER_ERROR_STATUS_LOST_SYNC);
decoder->protected_->state = FLAC__STREAM_DECODER_SEARCH_FOR_FRAME_SYNC;
- return true;
+ /* We have received a potentially malicious bit stream. All we can do is error out to avoid a heap overflow. */
+ return false;
}
}
else {