aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorReimar Döffinger <Reimar.Doeffinger@gmx.de>2009-07-04 18:24:43 +0000
committerReimar Döffinger <Reimar.Doeffinger@gmx.de>2009-07-04 18:24:43 +0000
commit82c9182fe363e85d9e84f94eddcc0aa46a3be310 (patch)
treee5a85e2fb33f0d5d9d563fb935eaf48433c0ec2f
parent1496b04c28ba9ef291bef1936641bff364484075 (diff)
downloadffmpeg-82c9182fe363e85d9e84f94eddcc0aa46a3be310.tar.gz
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. Originally committed as revision 19344 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r--libavcodec/mjpegdec.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c
index a40dfdbef5..a18403d268 100644
--- a/libavcodec/mjpegdec.c
+++ b/libavcodec/mjpegdec.c
@@ -1479,6 +1479,10 @@ not_the_end:
}
}
}
+ 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: