diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-01-14 20:53:42 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-01-14 20:56:08 +0100 |
commit | 2545182c294ff6b91ad36a575246788159e39f28 (patch) | |
tree | 77a6c87fdd9ef6357a5a0c9217d0b27ca81977e4 /libavcodec/mpegaudiodec_template.c | |
parent | b2ae92110f9ec31c254e85eb86719827e80362e6 (diff) | |
download | ffmpeg-2545182c294ff6b91ad36a575246788159e39f28.tar.gz |
avcodec/mpegaudiodec_template/mp3on4: check that all channels have been decoded before returnig a frame
Fixes use of uninitialized memory
Fixes: msan_uninit-mem_7f80bf9a259e_5774_id5_1.mp4
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/mpegaudiodec_template.c')
-rw-r--r-- | libavcodec/mpegaudiodec_template.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libavcodec/mpegaudiodec_template.c b/libavcodec/mpegaudiodec_template.c index be8ce6d56e..f5031925ed 100644 --- a/libavcodec/mpegaudiodec_template.c +++ b/libavcodec/mpegaudiodec_template.c @@ -1962,6 +1962,10 @@ static int decode_frame_mp3on4(AVCodecContext *avctx, void *data, avctx->bit_rate += m->bit_rate; } + if (ch != avctx->channels) { + av_log(avctx, AV_LOG_ERROR, "failed to decode all channels\n"); + return AVERROR_INVALIDDATA; + } /* update codec info */ avctx->sample_rate = s->mp3decctx[0]->sample_rate; |