aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2015-08-15 14:54:36 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2015-11-12 02:55:45 +0100
commitd165ec179e466bb165df7630e7a4b962d76aaa9f (patch)
tree5152d99f83987e9fc2e93a9ed82d4ce55b905e28
parent94541f5f76240dad953decc0b3dcdc782052c35b (diff)
downloadffmpeg-d165ec179e466bb165df7630e7a4b962d76aaa9f.tar.gz
avcodec/svq1enc: Check dimensions
Fixes assertion failure Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit 88fe45e0fe379d7ea86c8ac1e1e8cf2c3f62389f) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/svq1enc.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/svq1enc.c b/libavcodec/svq1enc.c
index 56031451de..31e317ae45 100644
--- a/libavcodec/svq1enc.c
+++ b/libavcodec/svq1enc.c
@@ -515,6 +515,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);