# HG changeset patch # User reimar # Date 1246731883 0 # Node ID f1707434e40b22fe5d7c5ff3f34b737a7c759e2c # Parent e1aaf6216769a55b0f104e80e481987c0387a1c7 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. diff -r e1aaf6216769 -r f1707434e40b mjpegdec.c --- 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: