[Ffmpeg-cvslog] CVS: ffmpeg/libavcodec mjpeg.c,1.111,1.112

Reimar Döffinger CVS reimar
Fri Jul 22 10:48:03 CEST 2005


Update of /cvsroot/ffmpeg/ffmpeg/libavcodec
In directory mail:/var2/tmp/cvs-serv26133

Modified Files:
	mjpeg.c 
Log Message:
reset restart_count when restart_interval is set and fill the
MJpegDecodeContext with 0 on init.


Index: mjpeg.c
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/libavcodec/mjpeg.c,v
retrieving revision 1.111
retrieving revision 1.112
diff -u -d -r1.111 -r1.112
--- mjpeg.c	17 Jul 2005 12:56:56 -0000	1.111
+++ mjpeg.c	22 Jul 2005 08:48:00 -0000	1.112
@@ -882,6 +882,7 @@
 {
     MJpegDecodeContext *s = avctx->priv_data;
     MpegEncContext s2;
+    memset(s, 0, sizeof(MJpegDecodeContext));
 
     s->avctx = avctx;
 
@@ -1573,6 +1574,7 @@
     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 @@
                 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 @@
 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);





More information about the ffmpeg-cvslog mailing list