[FFmpeg-cvslog] avcodec/svq1enc: Check dimensions

Michael Niedermayer git at videolan.org
Thu Nov 19 11:27:47 CET 2015


ffmpeg | branch: release/2.6 | Michael Niedermayer <michael at niedermayer.cc> | Sat Aug 15 14:54:36 2015 +0200| [6c32c9e1eff37a8e2e9d5444be1a1e0db652d27e] | committer: Michael Niedermayer

avcodec/svq1enc: Check dimensions

Fixes assertion failure

Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
(cherry picked from commit 88fe45e0fe379d7ea86c8ac1e1e8cf2c3f62389f)

Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

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

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

diff --git a/libavcodec/svq1enc.c b/libavcodec/svq1enc.c
index ec540a2..bd35e31 100644
--- a/libavcodec/svq1enc.c
+++ b/libavcodec/svq1enc.c
@@ -516,6 +516,11 @@ static av_cold int svq1_encode_init(AVCodecContext *avctx)
     SVQ1EncContext *const s = avctx->priv_data;
     int ret;
 
+    if (avctx->width >= 4096 || avctx->height >= 4096) {
+        av_log(avctx, AV_LOG_ERROR, "Dimensions too large, maximum is 4095x4095\n");
+        return AVERROR(EINVAL);
+    }
+
     ff_hpeldsp_init(&s->hdsp, avctx->flags);
     ff_me_cmp_init(&s->mecc, avctx);
     ff_mpegvideoencdsp_init(&s->m.mpvencdsp, avctx);



More information about the ffmpeg-cvslog mailing list