[Ffmpeg-devel] [PATCH] av_seek_binary() shouldn't call av_rescale() with c = 0

Andy Parkins andyparkins
Tue Jan 31 12:51:50 CET 2006


Hello,

I've found a bug, but I'm not sure the my fix is the correct way to deal with 
the problem.

I'm seeking around near the end of an MPEGTS wrapped MPEG4 stream.  I was 
getting crashes and 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() :-))

The attached simple 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.


Andy

-- 
Dr Andy Parkins, M Eng (hons), AMIEE
andyparkins at gmail.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ffmpeg-patch-060131-2.diff
Type: text/x-diff
Size: 538 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20060131/442418ae/attachment.diff>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20060131/442418ae/attachment.pgp>



More information about the ffmpeg-devel mailing list