Re: [FFmpeg-devel] [PATCH 2/2] all: use FFDIFFSIGN to resolve possible undefined behavior in comparators

2015-11-03 Thread Clément Bœsch
On Sun, Nov 01, 2015 at 07:29:36PM -0500, Ganesh Ajjanagadde wrote: [...] > I believe vf_palettegen and libavformat/subtitles are the only ones > lacking review, but may be mistaken. > Those are probably fine. -- Clément B. signature.asc Description: PGP signature

Re: [FFmpeg-devel] [PATCH 2/2] all: use FFDIFFSIGN to resolve possible undefined behavior in comparators

2015-11-03 Thread Ganesh Ajjanagadde
On Tue, Nov 3, 2015 at 5:54 AM, Clément Bœsch wrote: > On Sun, Nov 01, 2015 at 07:29:36PM -0500, Ganesh Ajjanagadde wrote: > [...] >> I believe vf_palettegen and libavformat/subtitles are the only ones >> lacking review, but may be mistaken. >> > > Those are probably fine. Pushed,

[FFmpeg-devel] [PATCH 2/2] all: use FFDIFFSIGN to resolve possible undefined behavior in comparators

2015-11-01 Thread Ganesh Ajjanagadde
FFDIFFSIGN was created explicitly for this purpose, since the common return a - b idiom is unsafe regarding overflow on signed integers. It optimizes to branchless code on common compilers. FFDIFFSIGN also has the subjective benefit of being easier to read due to lack of ternary operators.

Re: [FFmpeg-devel] [PATCH 2/2] all: use FFDIFFSIGN to resolve possible undefined behavior in comparators

2015-11-01 Thread Ganesh Ajjanagadde
On Sun, Nov 1, 2015 at 6:26 PM, Michael Niedermayer wrote: > On Sun, Nov 01, 2015 at 12:19:48PM -0500, Ganesh Ajjanagadde wrote: >> FFDIFFSIGN was created explicitly for this purpose, since the common >> return a - b idiom is unsafe regarding overflow on signed integers.

Re: [FFmpeg-devel] [PATCH 2/2] all: use FFDIFFSIGN to resolve possible undefined behavior in comparators

2015-11-01 Thread Michael Niedermayer
On Sun, Nov 01, 2015 at 12:19:48PM -0500, Ganesh Ajjanagadde wrote: > FFDIFFSIGN was created explicitly for this purpose, since the common > return a - b idiom is unsafe regarding overflow on signed integers. It > optimizes to branchless code on common compilers. > > FFDIFFSIGN also has the