[FFmpeg-devel] [PATCH] Avoid undefined behavior when start_time_text is -1<<63

Fredrik Hubinette hubbe at google.com
Mon Aug 20 23:03:31 EEST 2018


Ok, let's use cast, new patch attached.


On Mon, Jul 30, 2018 at 4:53 PM Michael Niedermayer <michael at niedermayer.cc>
wrote:

> On Mon, Jul 30, 2018 at 01:49:24PM -0700, Fredrik Hubinette wrote:
> > Is casting a negative integer to unsigned defined behavior?
>
> yes
>
> 6.3.1.3 Signed and unsigned integers
>
> 2 Otherwise, if the new type is unsigned, the value is converted by
> repeatedly adding or
>   subtracting one more than the maximum value that can be represented in
> the new type
>   until the value is in the range of the new type.49)
>
> [...]
> --
> Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
>
> I do not agree with what you have to say, but I'll defend to the death your
> right to say it. -- Voltaire
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-avoid-undefined-integer-overflow-behavior.patch
Type: text/x-patch
Size: 1073 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20180820/b7fdad5c/attachment.bin>


More information about the ffmpeg-devel mailing list