diff options
author | Reimar Döffinger <Reimar.Doeffinger@gmx.de> | 2005-07-22 08:48:00 +0000 |
---|---|---|
committer | Reimar Döffinger <Reimar.Doeffinger@gmx.de> | 2005-07-22 08:48:00 +0000 |
commit | 4eecd5bc66ed08f7cee245b621263cabf0b23dac (patch) | |
tree | dc6d2675d49035bf670a06daf6cfe8f36f21903b /libavcodec/mjpeg.c | |
parent | 276358c1c40311a068c17639fe4c0135710b7688 (diff) | |
download | ffmpeg-4eecd5bc66ed08f7cee245b621263cabf0b23dac.tar.gz |
reset restart_count when restart_interval is set and fill the
MJpegDecodeContext with 0 on init.
Originally committed as revision 4464 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/mjpeg.c')
-rw-r--r-- | libavcodec/mjpeg.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libavcodec/mjpeg.c b/libavcodec/mjpeg.c index 7aaf1e73ad..8f24b075cf 100644 --- a/libavcodec/mjpeg.c +++ b/libavcodec/mjpeg.c @@ -882,6 +882,7 @@ static int mjpeg_decode_init(AVCodecContext *avctx) { MJpegDecodeContext *s = avctx->priv_data; MpegEncContext s2; + memset(s, 0, sizeof(MJpegDecodeContext)); s->avctx = avctx; @@ -1573,6 +1574,7 @@ static int mjpeg_decode_dri(MJpegDecodeContext *s) if (get_bits(&s->gb, 16) != 4) return -1; s->restart_interval = get_bits(&s->gb, 16); + s->restart_count = 0; dprintf("restart interval: %d\n", s->restart_interval); return 0; @@ -1892,6 +1894,7 @@ static int mjpeg_decode_frame(AVCodecContext *avctx, switch(start_code) { case SOI: s->restart_interval = 0; + s->restart_count = 0; /* nothing to do on SOI */ break; case DQT: @@ -2000,6 +2003,7 @@ static int mjpegb_decode_frame(AVCodecContext *avctx, read_header: /* reset on every SOI */ s->restart_interval = 0; + s->restart_count = 0; s->mjpb_skiptosod = 0; init_get_bits(&hgb, buf_ptr, /*buf_size*/(buf_end - buf_ptr)*8); |