diff mbox series

[FFmpeg-devel,2/6] avcodec/apedec: Use FFABSU() in do_apply_filter()

Message ID 20210123221056.3366-2-michael@niedermayer.cc
State Accepted
Commit 59a6becf8ecb1ea25faaeaaf45f4d28de39606eb
Headers show
Series [FFmpeg-devel,1/6] avutil/common: Add FFABSU() for a signed -> unsigned ABS | expand

Checks

Context Check Description
andriy/x86_make success Make finished
andriy/x86_make_fate success Make fate finished
andriy/PPC64_make success Make finished
andriy/PPC64_make_fate success Make fate finished

Commit Message

Michael Niedermayer Jan. 23, 2021, 10:10 p.m. UTC
Fixes: negation of -2147483648 cannot be represented in type 'int'; cast to an unsigned type to negate this value to itself
Fixes: 29053/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_APE_fuzzer-4814432697974784

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
---
 libavcodec/apedec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Anton Khirnov Jan. 24, 2021, 1:13 p.m. UTC | #1
Quoting Michael Niedermayer (2021-01-23 23:10:52)
> Fixes: negation of -2147483648 cannot be represented in type 'int'; cast to an unsigned type to negate this value to itself
> Fixes: 29053/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_APE_fuzzer-4814432697974784
> 
> Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> ---
>  libavcodec/apedec.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Looks ok
Michael Niedermayer Jan. 26, 2021, 4:13 p.m. UTC | #2
On Sun, Jan 24, 2021 at 02:13:07PM +0100, Anton Khirnov wrote:
> Quoting Michael Niedermayer (2021-01-23 23:10:52)
> > Fixes: negation of -2147483648 cannot be represented in type 'int'; cast to an unsigned type to negate this value to itself
> > Fixes: 29053/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_APE_fuzzer-4814432697974784
> > 
> > Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
> > Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> > ---
> >  libavcodec/apedec.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> Looks ok

will apply

thx

[...]
diff mbox series

Patch

diff --git a/libavcodec/apedec.c b/libavcodec/apedec.c
index 8fe7b5ee86..388d851d03 100644
--- a/libavcodec/apedec.c
+++ b/libavcodec/apedec.c
@@ -1333,7 +1333,7 @@  static void do_apply_filter(APEContext *ctx, int version, APEFilter *f,
             /* Version 3.98 and later files */
 
             /* Update the adaption coefficients */
-            absres = FFABS(res);
+            absres = FFABSU(res);
             if (absres)
                 *f->adaptcoeffs = APESIGN(res) *
                                   (8 << ((absres > f->avg * 3) + (absres > f->avg * 4 / 3)));