aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2021-09-04 19:55:28 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2021-10-06 14:41:41 +0200
commitbdc6377bd193c73b1f607e81ea17fe9123e40aa6 (patch)
treeaa9cd30f047a043de5bc7416906b91a90f93f8c4
parentcce6d864183a7336fd61ab661f29aa616084b39e (diff)
downloadffmpeg-bdc6377bd193c73b1f607e81ea17fe9123e40aa6.tar.gz
avcodec/apedec: Fix 2 integer overflows in filter_3800()
Fixes: signed integer overflow: 1683879955 - -466265224 cannot be represented in type 'int' Fixes: 37419/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_APE_fuzzer-6074294407921664 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit 33feb527fff9bf547c4118147434869875cf0c3d) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/apedec.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/apedec.c b/libavcodec/apedec.c
index 4cbbfa40ad..6d507f272b 100644
--- a/libavcodec/apedec.c
+++ b/libavcodec/apedec.c
@@ -882,8 +882,8 @@ static av_always_inline int filter_3800(APEPredictor *p,
return predictionA;
}
d2 = p->buf[delayA];
- d1 = (p->buf[delayA] - p->buf[delayA - 1]) * 2U;
- d0 = p->buf[delayA] + ((p->buf[delayA - 2] - p->buf[delayA - 1]) * 8U);
+ d1 = (p->buf[delayA] - (unsigned)p->buf[delayA - 1]) * 2;
+ d0 = p->buf[delayA] + ((p->buf[delayA - 2] - (unsigned)p->buf[delayA - 1]) * 8);
d3 = p->buf[delayB] * 2U - p->buf[delayB - 1];
d4 = p->buf[delayB];