[Ffmpeg-cvslog] CVS: ffmpeg/libavcodec h263.c,1.285,1.286

Michael Niedermayer CVS michael
Sat Jul 30 18:15:40 CEST 2005


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

Modified Files:
	h263.c 
Log Message:
check time_base.den for mpeg4
avoid zero time_base.* for h263


Index: h263.c
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/libavcodec/h263.c,v
retrieving revision 1.285
retrieving revision 1.286
diff -u -d -r1.285 -r1.286
--- h263.c	24 Jul 2005 09:28:24 -0000	1.285
+++ h263.c	30 Jul 2005 16:15:36 -0000	1.286
@@ -5156,6 +5156,7 @@
                 s->avctx->time_base.num*= get_bits(&s->gb, 7);
                 if(s->avctx->time_base.num == 0){
                     av_log(s, AV_LOG_ERROR, "zero framerate\n");
+                    s->avctx->time_base= (AVRational){1001, 30000}; //prevent crash
                     return -1;
                 }
                 gcd= ff_gcd(s->avctx->time_base.den, s->avctx->time_base.num);
@@ -5538,6 +5539,10 @@
     check_marker(gb, "before time_increment_resolution");
     
     s->avctx->time_base.den = get_bits(gb, 16);
+    if(!s->avctx->time_base.den){
+        av_log(s->avctx, AV_LOG_ERROR, "time_base.den==0\n");
+        return -1;
+    }
     
     s->time_increment_bits = av_log2(s->avctx->time_base.den - 1) + 1;
     if (s->time_increment_bits < 1)





More information about the ffmpeg-cvslog mailing list