[FFmpeg-devel] Fix undefined behavior in ff_configure_buffers_for_index()

Dale Curtis dalecurtis at chromium.org
Thu Jan 30 01:25:32 EET 2020


On Wed, Jan 29, 2020 at 4:55 AM Michael Niedermayer <michael at niedermayer.cc>
wrote:

> simpler solution, and also behaves arithmetically more correct when the
> overflow happens in the othert direction:
>
> av_assert0(time_tolerance >= 0);
>
> if (e2_pts < e1_pts || e2_pts - (uint64_t)e1_pts < time_tolerance)
>

Does that work? e1_pts is INT64_MIN in this case. So the (uint64_t)e1_pts >
e2_pts.


More information about the ffmpeg-devel mailing list