[FFmpeg-cvslog] avcodec/on2avc: Check number of channels
Michael Niedermayer
git at videolan.org
Sat Oct 4 22:26:23 CEST 2014
ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sat Oct 4 22:15:07 2014 +0200| [550f3e9df3410b3dd975e590042c0d83e20a8da3] | committer: Michael Niedermayer
avcodec/on2avc: Check number of channels
Fixes out of array access
Fixes: asan_heap-oob_4da4f3_7_asan_heap-oob_4da4f3_173_Xmen_avc_500.vp6
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=550f3e9df3410b3dd975e590042c0d83e20a8da3
---
libavcodec/on2avc.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/libavcodec/on2avc.c b/libavcodec/on2avc.c
index ab6048b..e5e7cc3 100644
--- a/libavcodec/on2avc.c
+++ b/libavcodec/on2avc.c
@@ -908,6 +908,11 @@ static av_cold int on2avc_decode_init(AVCodecContext *avctx)
On2AVCContext *c = avctx->priv_data;
int i;
+ if (avctx->channels > 2U) {
+ avpriv_request_sample(avctx, "Decoding more than 2 channels");
+ return AVERROR_PATCHWELCOME;
+ }
+
c->avctx = avctx;
avctx->sample_fmt = AV_SAMPLE_FMT_FLTP;
avctx->channel_layout = (avctx->channels == 2) ? AV_CH_LAYOUT_STEREO
More information about the ffmpeg-cvslog
mailing list