diff mbox series

[FFmpeg-devel,2/2] avcodec/apedec: Use unsigned in long_filter_ehigh_3830() to avoid undefined overflow

Message ID 20210921231438.16335-2-michael@niedermayer.cc
State New
Headers show
Series [FFmpeg-devel,1/2] avformat/concatdec: Use FAIL() macro instead of direct return in concat_parse_script()
Related show

Checks

Context Check Description
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished
andriy/make_ppc success Make finished
andriy/make_fate_ppc success Make fate finished

Commit Message

Michael Niedermayer Sept. 21, 2021, 11:14 p.m. UTC
Fixes: signed integer overflow: -2145648640 - 3357696 cannot be represented in type 'int'
Fixes: 38899/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_APE_fuzzer-535881501756620

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(-)
diff mbox series

Patch

diff --git a/libavcodec/apedec.c b/libavcodec/apedec.c
index 050523601d5..57d6de64cdf 100644
--- a/libavcodec/apedec.c
+++ b/libavcodec/apedec.c
@@ -979,7 +979,7 @@  static void long_filter_ehigh_3830(int32_t *buffer, int length)
         for (j = 7; j > 0; j--)
             delay[j] = delay[j - 1];
         delay[0] = buffer[i];
-        buffer[i] -= dotprod >> 9;
+        buffer[i] -= (unsigned)(dotprod >> 9);
     }
 }