[Ffmpeg-devel] [PATCH] ffmpeg bug. av_seek_binary() wasnt' checking for divide-by-zero potential

Michael Niedermayer michaelni
Wed Dec 6 16:32:01 CET 2006


On Wed, Dec 06, 2006 at 01:08:39PM +0100, Andy Parkins wrote:
> libavformat/utils.c
>  * When seeking around near the end of an MPEGTS wrapped MPEG4 stream.  I was
>    getting crashes. I traced it to lavf/utils.c/av_seek_frame_binary(); which
>    is calling av_rescale() even in situations that will lead to a floating point
>    error.  I think the problem is that I'm seeking very small distances and
>    there are probably few (or no) keyframes between the two positions (but then
>    again, I don't entirely understand av_seek_frame_binary() :-))
>    This patch, checks for the invalid condition (ts_max==ts_min)
>    and hence allows av_seek_frame_binary()  to fall back to a linear search
>    rather than just crashing.

ts_max == ts_min with positions missmatching is a error and should be handeld
as such (either return -1 and or seek to something between the positions)
continuing the binary search has no sense

Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

If you really think that XML is the answer, then you definitly missunderstood
the question -- Attila Kinali

More information about the ffmpeg-devel mailing list