changeset 9915:f1707434e40b libavcodec

If the end of the input buffer is reached while decoding MJPEG and at least a valid SOF was found, emulate an EOI. This allows e.g. to at least decode the available part of incomplete MJPEG frames.
author reimar
date Sat, 04 Jul 2009 18:24:43 +0000
parents e1aaf6216769
children 2c1c28f26a27
files mjpegdec.c
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mjpegdec.c	Sat Jul 04 18:22:33 2009 +0000
+++ b/mjpegdec.c	Sat Jul 04 18:24:43 2009 +0000
@@ -1479,6 +1479,10 @@
             }
         }
     }
+    if (s->got_picture) {
+        av_log(avctx, AV_LOG_WARNING, "EOI missing, emulating\n");
+        goto eoi_parser;
+    }
     av_log(avctx, AV_LOG_FATAL, "No JPEG data found in image\n");
     return -1;
 the_end: