[FFmpeg-devel] [PATCH] Avoid setting a zero timebase denominator in rtpdec

Martin Storsjö martin
Thu Jan 28 22:01:40 CET 2010


If trying to view an RTSP/RTP stream with an unsupported audio codec, the 
st->codec->sample_rate field is left at zero (since it is set in 
rtsp.c:145, only if a decoder was found). The zero sample rate propagates 
to the st->timebase.den field at rtpdec.c:313, leading to crashes due to 
division by zero when using such a time base.

The attached patch avoids the crashes by not propagating a clearly 
erroneous sample rate and emits a warning message instead.

// Martin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fix-rtpdec-crash.patch
Type: text/x-diff
Size: 1036 bytes
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100128/f8fbfd8c/attachment.patch>

More information about the ffmpeg-devel mailing list