From 0cd17a6291bdd5e3d89dad2bac96393af92ac9bd Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Thu, 12 Apr 2012 01:29:04 +0200 Subject: [PATCH] mjpeg: fix crash with lowres and flipped images Fixes Ticket1155 Signed-off-by: Michael Niedermayer --- libavcodec/mjpegdec.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c index b0f6fdf0fd..c3e69f69e1 100644 --- a/libavcodec/mjpegdec.c +++ b/libavcodec/mjpegdec.c @@ -974,6 +974,10 @@ static int mjpeg_decode_scan(MJpegDecodeContext *s, int nb_components, int Ah, "Can not flip image with CODEC_FLAG_EMU_EDGE set!\n"); s->flipped = 0; } + if (s->flipped && s->avctx->lowres) { + av_log(s->avctx, AV_LOG_ERROR, "Can not flip image with lowres\n"); + s->flipped = 0; + } for (i = 0; i < nb_components; i++) { int c = s->comp_index[i];