aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-05-13 11:11:56 +0200
committerMichael Niedermayer <michaelni@gmx.at>2012-05-13 11:24:46 +0200
commitd5df0df848be473e06ace48ecec223ef1c389644 (patch)
tree865dba343174b4afc2cf9e9409d1214a228db24b
parentf153dfc9e44f6f1d26ebeb032b66f09279efabad (diff)
downloadffmpeg-d5df0df848be473e06ace48ecec223ef1c389644.tar.gz
mpeg1enc: check input dimensions
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavcodec/mpegvideo_enc.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c
index cba7d9d9a2..1fffcca576 100644
--- a/libavcodec/mpegvideo_enc.c
+++ b/libavcodec/mpegvideo_enc.c
@@ -495,6 +495,13 @@ av_cold int ff_MPV_encode_init(AVCodecContext *avctx)
return -1;
}
+ if (s->codec_id == CODEC_ID_MPEG1VIDEO &&
+ (avctx->width > 4095 ||
+ avctx->height > 4095 )) {
+ av_log(avctx, AV_LOG_ERROR, "MPEG-1 does not support resolutions above 4095x4095\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");