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

Michael Niedermayer michael at niedermayer.cc
Tue Jul 31 02:53:39 EEST 2018


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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20180731/db272abc/attachment.sig>


More information about the ffmpeg-devel mailing list