[FFmpeg-devel] [PATCH] oggdec: do not set time_base to invalid value

Reimar Döffinger Reimar.Doeffinger
Sat Dec 11 18:00:24 CET 2010


Hello,
possible we should consider catching this at a higher level, and possibly
st->codec->sample_rate should not be assigned an invalid value either...
Vorbis ogg parser may set st->time_base.den to 0, causing an
assertion failure in av_rescale_* during av_update_stream_timings.
Below patch is one way to fix.
Original bug report against MPlayer with sample files: http://bugzilla.mplayerhq.hu/show_bug.cgi?id=1189
Index: ffmpeg/libavformat/oggparsevorbis.c
===================================================================
--- ffmpeg/libavformat/oggparsevorbis.c (revision 25928)
+++ ffmpeg/libavformat/oggparsevorbis.c (working copy)
@@ -250,6 +260,7 @@
         st->codec->codec_id = CODEC_ID_VORBIS;
 
         st->time_base.num = 1;
+        if (st->codec->sample_rate > 0)
         st->time_base.den = st->codec->sample_rate;
     } else if (os->buf[os->pstart] == 3) {
         if (os->psize > 8)




More information about the ffmpeg-devel mailing list