[FFmpeg-cvslog] avcodec/mjpegenc: disallow encoding amv with height%16!=0
Michael Niedermayer
git at videolan.org
Sun Jun 1 04:31:08 CEST 2014
ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sun Jun 1 03:57:17 2014 +0200| [181b2c37249c60033071b2744da4941a5f8ec0d3] | committer: Michael Niedermayer
avcodec/mjpegenc: disallow encoding amv with height%16!=0
I do not know on which side to place the padding to encode with 16x16 MBs
If someone knows or has a known to be correct sample, please contact me
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=181b2c37249c60033071b2744da4941a5f8ec0d3
---
libavcodec/mjpegenc.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/libavcodec/mjpegenc.c b/libavcodec/mjpegenc.c
index 842528e..e33e75f 100644
--- a/libavcodec/mjpegenc.c
+++ b/libavcodec/mjpegenc.c
@@ -539,6 +539,13 @@ static int amv_encode_picture(AVCodecContext *avctx, AVPacket *pkt,
if(s->avctx->flags & CODEC_FLAG_EMU_EDGE)
return AVERROR(EINVAL);
+ if (avctx->height & 15) {
+ av_log(avctx, AV_LOG_ERROR,
+ "Height must be a multiple of 16, also note, "
+ "if you have a AMV sample thats mod 16 != 0, please contact us\n");
+ return AVERROR(EINVAL);
+ }
+
pic = av_frame_clone(pic_arg);
if (!pic)
return AVERROR(ENOMEM);
More information about the ffmpeg-cvslog
mailing list