diff --git a/libavcodec/mjpegenc.c b/libavcodec/mjpegenc.c index 842528e5f1..e33e75fbc8 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);