[FFmpeg-devel] [PATCH] check for invalid (0,0) timebase in avidec

Reimar Döffinger Reimar.Doeffinger
Wed Jul 1 20:48:48 CEST 2009


Hello,
this is related to issue 1245.
The problem is that the avi demuxer in some places assumes a valid time
base, but does not valid the data it reads or (in this case) just never
reads and sets any time base at all.
This patch fixes this, but seeking still results in
ffplay_g: libavformat/avidec.c:1085: avi_read_seek: Assertion `(int64_t)st2->time_base.num*ast2->rate == (int64_t)st2->time_base.den*ast2->scale' failed.
and I have no idea what that assert is about...
Index: libavformat/avidec.c
===================================================================
--- libavformat/avidec.c	(revision 19317)
+++ libavformat/avidec.c	(working copy)
@@ -673,6 +677,8 @@
             AVIStream *ast = st->priv_data;
             int64_t ts= ast->frame_offset;
 
+            if(!st->time_base.num || !st->time_base.den)
+                continue;
             if(ast->sample_size)
                 ts /= ast->sample_size;
             ts= av_rescale(ts, AV_TIME_BASE * (int64_t)st->time_base.num, st->time_base.den);
@@ -1072,7 +1078,7 @@
         ast2->packet_size=
         ast2->remaining= 0;
 
-        if (st2->nb_index_entries <= 0)
+        if (st2->nb_index_entries <= 0 || !st2->time_base.num || !st2->time_base.den)
             continue;
 
 //        assert(st2->codec->block_align);



More information about the ffmpeg-devel mailing list