avcodec/mjpegdec: only run EOI emulation code when there was a scan
authorMichael Niedermayer <michaelni@gmx.at>
Sun, 19 Jan 2014 03:56:13 +0000 (04:56 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Sun, 19 Jan 2014 03:57:03 +0000 (04:57 +0100)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/mjpegdec.c

index ab4d2ba..df62ebc 100644 (file)
@@ -1951,7 +1951,7 @@ eoi_parser:
                "marker parser used %d bytes (%d bits)\n",
                (get_bits_count(&s->gb) + 7) / 8, get_bits_count(&s->gb));
     }
-    if (s->got_picture) {
+    if (s->got_picture && s->cur_scan) {
         av_log(avctx, AV_LOG_WARNING, "EOI missing, emulating\n");
         goto eoi_parser;
     }