[FFmpeg-cvslog] mpeg4videoenc: check w, h to be within the supported range.

Michael Niedermayer git at videolan.org
Thu Jan 24 04:46:51 CET 2013


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Thu Jan 24 04:38:17 2013 +0100| [7e059c9c5d7885d9c41ddff4449e1b642cb1ec34] | committer: Michael Niedermayer

mpeg4videoenc: check w,h to be within the supported range.

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

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

 libavcodec/mpeg4videoenc.c |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/libavcodec/mpeg4videoenc.c b/libavcodec/mpeg4videoenc.c
index 0cc4df9..a07f956 100644
--- a/libavcodec/mpeg4videoenc.c
+++ b/libavcodec/mpeg4videoenc.c
@@ -1234,6 +1234,11 @@ static av_cold int encode_init(AVCodecContext *avctx)
     int ret;
     static int done = 0;
 
+    if (avctx->width >= (1<<13) || avctx->height >= (1<<13)) {
+        av_log(avctx, AV_LOG_ERROR, "dimensions too large for MPEG-4\n");
+        return AVERROR(EINVAL);
+    }
+
     if((ret=ff_MPV_encode_init(avctx)) < 0)
         return ret;
 



More information about the ffmpeg-cvslog mailing list