diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-05-13 11:12:20 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-05-13 11:24:46 +0200 |
commit | 6b0a0dc555e77b376c4a543d73ec295f2c651210 (patch) | |
tree | b7a10cc9985d1e35d23fdc3ea35dcd0f23737ffb | |
parent | d5df0df848be473e06ace48ecec223ef1c389644 (diff) | |
download | ffmpeg-6b0a0dc555e77b376c4a543d73ec295f2c651210.tar.gz |
mpeg2enc: check input dimensions
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavcodec/mpegvideo_enc.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c index 1fffcca576..88b177740c 100644 --- a/libavcodec/mpegvideo_enc.c +++ b/libavcodec/mpegvideo_enc.c @@ -502,6 +502,12 @@ av_cold int ff_MPV_encode_init(AVCodecContext *avctx) return -1; } + if (s->codec_id == CODEC_ID_MPEG2VIDEO && + (avctx->width > 16383 || + avctx->height > 16383 )) { + av_log(avctx, AV_LOG_ERROR, "MPEG-2 does not support resolutions above 16383x16383\n"); + return -1; + } if ((s->flags & (CODEC_FLAG_INTERLACED_DCT | CODEC_FLAG_INTERLACED_ME)) && s->codec_id != CODEC_ID_MPEG4 && s->codec_id != CODEC_ID_MPEG2VIDEO) { av_log(avctx, AV_LOG_ERROR, "interlacing not supported by codec\n"); |