Commit 181b2c37 authored by Michael Niedermayer's avatar 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: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 149be913
...@@ -539,6 +539,13 @@ static int amv_encode_picture(AVCodecContext *avctx, AVPacket *pkt, ...@@ -539,6 +539,13 @@ static int amv_encode_picture(AVCodecContext *avctx, AVPacket *pkt,
if(s->avctx->flags & CODEC_FLAG_EMU_EDGE) if(s->avctx->flags & CODEC_FLAG_EMU_EDGE)
return AVERROR(EINVAL); 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); pic = av_frame_clone(pic_arg);
if (!pic) if (!pic)
return AVERROR(ENOMEM); return AVERROR(ENOMEM);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment