On Tue, Apr 19, 2016 at 10:00 PM, Mark Thompson <[email protected]> wrote:
> On 19/04/16 20:45, Luca Barbato wrote:
>> ...
>> -                *f->adaptcoeffs = ((res & ((~0UL) << 31)) ^ ((~0UL) << 30)) 
>> >>
>> +                *f->adaptcoeffs = ((res & (int)((~0UL) << 31)) ^ 
>> (int)((~0UL) << 30)) >>
>
> (int)((~0UL) << 31) is signed integer overflow and therefore undefined 
> behaviour.
>
> This is trying to choose between two values depending on whether the sign bit 
> of a 32-bit int is set or not?
>
> Maybe just remove all the overly-clever shifting and write a conditional.  It 
> would also be clearer what's going on.
>

This sounds familier, look at these:

http://git.videolan.org/?p=ffmpeg.git;a=commitdiff;h=d3e5fbb1406995e07fccbff3ca8c1e24f57a1f7b
http://git.videolan.org/?p=ffmpeg.git;a=commitdiff;h=c4c389aa146a8a4e6fb8cfe43ddeea537e9cb510

- Hendrik
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to