[FFmpeg-cvslog] mjpeg: fix crash with lowres and flipped images

Michael Niedermayer git at videolan.org
Thu Apr 12 02:07:06 CEST 2012


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Thu Apr 12 01:29:04 2012 +0200| [0cd17a6291bdd5e3d89dad2bac96393af92ac9bd] | committer: Michael Niedermayer

mjpeg: fix crash with lowres and flipped images

Fixes Ticket1155

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=0cd17a6291bdd5e3d89dad2bac96393af92ac9bd
---

 libavcodec/mjpegdec.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c
index b0f6fdf..c3e69f6 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];



More information about the ffmpeg-cvslog mailing list