diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-10-04 22:15:07 +0200 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2014-12-19 08:01:47 +0100 |
commit | cee4490b521fd0d02476d46aa2598af24fb8d686 (patch) | |
tree | 4f586c7155cea104f325e7eda9b3ca170d53aaa7 | |
parent | d423dd72be451462c6fb1cbbe313bed0194001ab (diff) | |
download | ffmpeg-cee4490b521fd0d02476d46aa2598af24fb8d686.tar.gz |
on2avc: check number of channels
Fixes invalid memory access.
CC: libav-stable@libav.org
Bug-ID: CVE-2014-8549
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Anton Khirnov <anton@khirnov.net>
-rw-r--r-- | libavcodec/on2avc.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libavcodec/on2avc.c b/libavcodec/on2avc.c index deaa2b4c04..c00339f7b0 100644 --- a/libavcodec/on2avc.c +++ b/libavcodec/on2avc.c @@ -918,6 +918,10 @@ static av_cold int on2avc_decode_init(AVCodecContext *avctx) av_log(avctx, AV_LOG_ERROR, "0x500 version should be mono\n"); return AVERROR_INVALIDDATA; } + if (avctx->channels > 2) { + av_log(avctx, AV_LOG_ERROR, "Only 1 or 2 channels are supported.\n"); + return AVERROR(EINVAL); + } if (avctx->channels == 2) av_log(avctx, AV_LOG_WARNING, "Stereo mode support is not good, patch is welcome\n"); |