[FFmpeg-devel,4/6] avcodec/takdec: Fix integer overflow in decorrelate()

Submitted by Michael Niedermayer on Aug. 25, 2019, 6:41 p.m.

Details

Message ID 20190825184158.10244-4-michael@niedermayer.cc
State New
Headers show

Commit Message

Michael Niedermayer Aug. 25, 2019, 6:41 p.m.
Fixes: signed integer overflow: -2424832 - 2145653689 cannot be represented in type 'int'
Fixes: 16138/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TAK_fuzzer-5643451346976768

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

Comments

Michael Niedermayer Sept. 11, 2019, 8:47 p.m.
On Sun, Aug 25, 2019 at 08:41:56PM +0200, Michael Niedermayer wrote:
> Fixes: signed integer overflow: -2424832 - 2145653689 cannot be represented in type 'int'
> Fixes: 16138/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TAK_fuzzer-5643451346976768
> 
> Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> ---
>  libavcodec/takdec.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

will apply

[...]

Patch hide | download patch | download mbox

diff --git a/libavcodec/takdec.c b/libavcodec/takdec.c
index 0439a3ac9b..4fb5825532 100644
--- a/libavcodec/takdec.c
+++ b/libavcodec/takdec.c
@@ -653,7 +653,7 @@  static int decorrelate(TAKDecContext *s, int c1, int c2, int length)
                          s->residues[i    ] * s->filter[0];
                 }
 
-                v = av_clip_intp2(v >> 10, 13) * (1 << dshift) - *p1;
+                v = av_clip_intp2(v >> 10, 13) * (1U << dshift) - *p1;
                 *p1++ = v;
             }