[FFmpeg-devel] [PATCH] avfilter/src_movie: fix how we check for overflows with seek_point
Michael Niedermayer
michael at niedermayer.cc
Sun Apr 3 01:47:56 CEST 2016
On Sat, Apr 02, 2016 at 09:11:44PM +0300, Marios Titas wrote:
> Currently, if the movie source filter is used and a seek_point is
> specified on a file that has a negative start time, ffmpeg will fail.
>
> An easy way to reproduce this is as follows:
> $ ffmpeg -vsync passthrough -filter_complex 'color=d=10,setpts=PTS-1/TB' test.mp4
> $ ffmpeg -filter_complex 'movie=filename=test.mp4:seek_point=2' -f null -
can you add a fate test ?
>
> The problem is caused by checking for int64_t overflow the wrong way.
> In general, to check whether a + b overflows, it is not enough to do:
> a > INT64_MAX - b
> because b might be negative; the correct way is:
> b > 0 && > a > INT64_MAX - b
> ---
> libavfilter/src_movie.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
applied
note, if one is pedantic then the timestamp > 0 check is unneeed or
if one assumes te surrounding code can be changed to produce < 0
then a underflow check is missing
just saying in case someone wants to fix that pedantic issue
thx
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
The real ebay dictionary, page 2
"100% positive feedback" - "All either got their money back or didnt complain"
"Best seller ever, very honest" - "Seller refunded buyer after failed scam"
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20160403/90288866/attachment.sig>
More information about the ffmpeg-devel
mailing list