avcodec/mjpegdec: Check for rgb before flipping
authorMichael Niedermayer <michael@niedermayer.cc>
Sat, 31 Dec 2016 02:08:33 +0000 (03:08 +0100)
committerMichael Niedermayer <michael@niedermayer.cc>
Wed, 8 Feb 2017 20:17:50 +0000 (21:17 +0100)
Fixes assertion failure due to unsupported case

Fixes: 356/fuzz-1-ffmpeg_VIDEO_AV_CODEC_ID_MJPEG_fuzzer
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 25d9643f1172ae6a210c671195ba3135895abaf3)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavcodec/mjpegdec.c

index adc2597..6587931 100644 (file)
@@ -2308,7 +2308,7 @@ the_end:
             }
         }
     }
-    if (s->flipped) {
+    if (s->flipped && !s->rgb) {
         int j;
         avcodec_get_chroma_sub_sample(s->avctx->pix_fmt, &hshift, &vshift);
         for (index=0; index<4; index++) {