[FFmpeg-cvslog] on2avc: check number of channels

Michael Niedermayer git at videolan.org
Sat Dec 20 12:30:56 CET 2014


ffmpeg | branch: release/2.4 | Michael Niedermayer <michaelni at gmx.at> | Sat Oct  4 22:15:07 2014 +0200| [48952116352ab03565cc14805e0f1d63cf0318fe] | committer: Anton Khirnov

on2avc: check number of channels

Fixes invalid memory access.

CC: libav-stable at libav.org
Bug-ID: CVE-2014-8549
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Anton Khirnov <anton at khirnov.net>
(cherry picked from commit cee4490b521fd0d02476d46aa2598af24fb8d686)
Signed-off-by: Anton Khirnov <anton at khirnov.net>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=48952116352ab03565cc14805e0f1d63cf0318fe
---

 libavcodec/on2avc.c |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/libavcodec/on2avc.c b/libavcodec/on2avc.c
index 60f451c..1c4b3c9 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");



More information about the ffmpeg-cvslog mailing list