diff options
author | Reimar Döffinger <Reimar.Doeffinger@gmx.de> | 2011-08-27 21:55:57 +0200 |
---|---|---|
committer | Reimar Döffinger <Reimar.Doeffinger@gmx.de> | 2011-09-01 22:54:35 +0200 |
commit | 55a1fe7a803027ebb202f790c5b77b0e1de6af5d (patch) | |
tree | fb36555693209e80deb1f03febf314477615432e /libavcodec/mjpegdec.c | |
parent | d5d7de7671c92bb62ea3f4dff5c23646bae46510 (diff) | |
download | ffmpeg-55a1fe7a803027ebb202f790c5b77b0e1de6af5d.tar.gz |
Reset cur_scan at more appropriate places.
Reset it when we actually process an EOI, not when we actually
decide to ignore it for bug-workarounds, and reset it on
SOF to make it more reliable in case of missing EOI.
Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
Diffstat (limited to 'libavcodec/mjpegdec.c')
-rw-r--r-- | libavcodec/mjpegdec.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c index e3c1b38163..da0c5a959d 100644 --- a/libavcodec/mjpegdec.c +++ b/libavcodec/mjpegdec.c @@ -219,6 +219,8 @@ int ff_mjpeg_decode_sof(MJpegDecodeContext *s) { int len, nb_components, i, width, height, pix_fmt_id; + s->cur_scan = 0; + /* XXX: verify len field validity */ len = get_bits(&s->gb, 16); s->bits= get_bits(&s->gb, 8); @@ -1484,10 +1486,10 @@ int ff_mjpeg_decode_frame(AVCodecContext *avctx, return -1; break; case EOI: - s->cur_scan = 0; if ((s->buggy_avid && !s->interlaced) || s->restart_interval) break; eoi_parser: + s->cur_scan = 0; if (!s->got_picture) { av_log(avctx, AV_LOG_WARNING, "Found EOI before any SOF, ignoring\n"); break; |