[FFmpeg-devel] [PATCH] avcodec/flacdsp: Avoid undefined operations in non debug builds
michael at niedermayer.cc
Sat Feb 4 04:02:19 EET 2017
On Thu, Dec 15, 2016 at 01:32:18AM +0100, Michael Niedermayer wrote:
> This fixes ubsan warnings in non debug builds by using unsigned operations
> in debug builds the correct signed operations are retained so that overflows
> (which should not occur in valid files and may indicate problems in the DSP code
> or decoder) can be detected.
> Alternatively they can be changed to unsigned unconditionally, then its
> not possible though to detect overflows easily if someone wants to test
> the DSP code for overflows.
> The 2nd alternative would be to leave the code as it is and accept that
> there are undefined operations in the DSP code and that ubsan output is
> full of them in some cases.
> Similar changes would be needed in some other DSP routines
> Suggested-by: Matt Wolenetz <wolenetz at google.com>
> Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
> libavcodec/flacdsp.c | 14 +++++++++++---
> 1 file changed, 11 insertions(+), 3 deletions(-)
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
If you drop bombs on a foreign country and kill a hundred thousand
innocent people, expect your government to call the consequence
"unprovoked inhuman terrorist attacks" and use it to justify dropping
more bombs and killing more people. The technology changed, the idea is old.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 181 bytes
Desc: Digital signature
More information about the ffmpeg-devel