]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/mjpegdec.c
avcodec/mjpegdec: fix SOF check in EOI
[ffmpeg] / libavcodec / mjpegdec.c
index 16aed078f66b3d2fd7acc9f2de310e2d95e4ca83..c8291722001345120b6401397ea43dbdffc98c78 100644 (file)
@@ -2560,11 +2560,16 @@ eoi_parser:
                 s->progressive && s->cur_scan && s->got_picture)
                 mjpeg_idct_scan_progressive_ac(s);
             s->cur_scan = 0;
-            if (!s->got_picture) {
+            if (!s->seen_sof) {
                 av_log(avctx, AV_LOG_WARNING,
                        "Found EOI before any SOF, ignoring\n");
                 break;
             }
+            if (!s->got_picture && avctx->skip_frame != AVDISCARD_ALL) {
+                av_log(avctx, AV_LOG_WARNING,
+                       "Found EOI before any SOS, ignoring\n");
+                break;
+            }
             if (s->interlaced) {
                 s->bottom_field ^= 1;
                 /* if not bottom field, do not output image yet */