]> git.sesse.net Git - ffmpeg/commitdiff
avcodec/ilbcdec: Fix integer overflow in construct_vector()
authorMichael Niedermayer <michael@niedermayer.cc>
Mon, 14 Jan 2019 23:02:25 +0000 (00:02 +0100)
committerMichael Niedermayer <michael@niedermayer.cc>
Mon, 28 Jan 2019 00:09:38 +0000 (01:09 +0100)
webrtc contains explicit code to ignore the undefined behavior (RTC_NO_SANITIZE / OverflowingAddS32S32ToS32())

Probably fixes: Integer overflow (unreproducable here)
Probably fixes: 12215/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ILBC_fuzzer-5767142427852800

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

index 50012c02317ca79d21d6198a66a67b08de241744..643547f4ab96984482db2fd517030386f946f1cc 100644 (file)
@@ -745,7 +745,7 @@ static void construct_vector (
     for (j = 0; j < veclen; j++) {
         a32 = SPL_MUL_16_16(*gainPtr++, cbvec0[j]);
         a32 += SPL_MUL_16_16(*gainPtr++, cbvec1[j]);
-        a32 += SPL_MUL_16_16(*gainPtr, cbvec2[j]);
+        a32 += (unsigned)SPL_MUL_16_16(*gainPtr, cbvec2[j]);
         gainPtr -= 2;
         decvector[j] = (a32 + 8192) >> 14;
     }