[FFmpeg-trac] #7997(avcodec:closed): undefined-behavior at libavcodec/proresenc_anatoliy.c

FFmpeg trac at avcodec.org
Thu Jan 9 16:47:55 EET 2020


#7997: undefined-behavior at libavcodec/proresenc_anatoliy.c
------------------------------------+-----------------------------------
             Reporter:  Suhwan      |                    Owner:
                 Type:  defect      |                   Status:  closed
             Priority:  normal      |                Component:  avcodec
              Version:  git-master  |               Resolution:  fixed
             Keywords:  ubsan       |               Blocked By:
             Blocking:              |  Reproduced by developer:  0
Analyzed by developer:  0           |
------------------------------------+-----------------------------------
Changes (by mkver):

 * component:  undetermined => avcodec


Comment:

 Replying to [comment:3 Balling]:
 > Fixed in 198081efb7c7343349f0a7acc836f001c511e990
 >
 > You know, you cannot right shift negative values as well?
 That's not true: Right shifting negative values (by a nonnegative value
 that is less than the width of the (promoted) left operand) is
 implementation-defined and FFmpeg requires this to use sign-extension (see
 [https://ffmpeg.org/developer.html#C-language-features here]). That's also
 why UBSan doesn't complain about the right shift.

 In contrast, left shifting of negative values is undefined.

--
Ticket URL: <https://trac.ffmpeg.org/ticket/7997#comment:4>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list