[FFmpeg-devel] undefined left shift of negative number (clang 3.7+ warnings)

Ganesh Ajjanagadde gajjanag at mit.edu
Fri Sep 18 15:43:46 CEST 2015

Hi all,

Would like to bring to attention the undefined left shift of negative
numbers that are found by latest clang 3.7.0 (-Wshift-negative-value).
I send this because I have no idea important they are, but clearly
they are of the type that interests static analyzers/fuzzers:

Anyway, I am not submitting a patch for one of them myself
(libavcodec/apedec) as I do not even know whether current code is
correct, e.g does it actually implicitly assume res (of type int) is
32 bits, and the shift by 30/31 is for high order bit stuff? In that
case, additional change to int32_t is needed.

More can be found e.g


More information about the ffmpeg-devel mailing list