From 388241efa2dfc4937fa5c9940ed0bc078e484b9d Mon Sep 17 00:00:00 2001 From: Piotr Bandurski Date: Sat, 15 Dec 2012 17:51:26 +0100 Subject: mpegvideo_enc/rv20: width and height must be multiple of 4 RealPlayer does not play rv20 files when sizes are not multiple of 4 Signed-off-by: Michael Niedermayer --- libavcodec/mpegvideo_enc.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'libavcodec/mpegvideo_enc.c') diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c index 92bd94acc3..08dcf9e793 100644 --- a/libavcodec/mpegvideo_enc.c +++ b/libavcodec/mpegvideo_enc.c @@ -561,6 +561,13 @@ av_cold int ff_MPV_encode_init(AVCodecContext *avctx) return AVERROR(EINVAL); } + if (s->codec_id == AV_CODEC_ID_RV20 && + (avctx->width &3 || + avctx->height&3 )) { + av_log(avctx, AV_LOG_ERROR, "width and height must be a multiple of 4\n"); + return AVERROR(EINVAL); + } + if ((s->codec_id == AV_CODEC_ID_WMV1 || s->codec_id == AV_CODEC_ID_WMV2) && avctx->width & 1) { -- cgit v1.2.3