]> git.sesse.net Git - ffmpeg/commitdiff
avcodec/svq1enc: Check dimensions
authorMichael Niedermayer <michael@niedermayer.cc>
Sat, 15 Aug 2015 12:54:36 +0000 (14:54 +0200)
committerMichael Niedermayer <michael@niedermayer.cc>
Sat, 15 Aug 2015 13:06:01 +0000 (15:06 +0200)
Fixes assertion failure

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavcodec/svq1enc.c

index ab9c2211610f09e11365be7f5b418a87c85ba4a3..1e1745e7b10ed24e8a600d643b5aa951317f2aba 100644 (file)
@@ -526,6 +526,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);