[FFmpeg-cvslog] avcodec/takdsp: Fix negative shift in decorrelate_sf()

Michael Niedermayer git at videolan.org
Sat Oct 10 14:09:03 EEST 2020


ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Thu Sep 24 21:59:04 2020 +0200| [4f54f530039db149808478796e8389c14eb73095] | committer: Michael Niedermayer

avcodec/takdsp: Fix negative shift in decorrelate_sf()

Fixes: left shift of negative value -4
Fixes: 25723/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TAK_fuzzer-6250580752990208

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=4f54f530039db149808478796e8389c14eb73095
---

 libavcodec/takdsp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/takdsp.c b/libavcodec/takdsp.c
index 2441c2baa6..9cb8052596 100644
--- a/libavcodec/takdsp.c
+++ b/libavcodec/takdsp.c
@@ -65,7 +65,7 @@ static void decorrelate_sf(int32_t *p1, int32_t *p2, int length, int dshift, int
     for (i = 0; i < length; i++) {
         int32_t a = p1[i];
         int32_t b = p2[i];
-        b         = dfactor * (b >> dshift) + 128 >> 8 << dshift;
+        b         = (unsigned)(dfactor * (b >> dshift) + 128 >> 8) << dshift;
         p1[i]     = b - a;
     }
 }



More information about the ffmpeg-cvslog mailing list