aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2018-01-31 02:50:18 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2018-07-08 13:07:06 +0200
commit7cc7346dfdefb91c99b6dea9222a2cebc53c8a04 (patch)
tree80b946fd2a0e5a0e8d52827a471d76b6583558ca
parent7aed596664424074196474e311f6084f10ae725d (diff)
downloadffmpeg-7cc7346dfdefb91c99b6dea9222a2cebc53c8a04.tar.gz
avcodec/wavpack: Fix integer overflow in FFABS
Fixes: negation of -2147483648 cannot be represented in type 'int'; cast to an unsigned type to negate this value to itself Fixes: 5396/clusterfuzz-testcase-minimized-6558555529281536 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit 8e50bd61e4ff97bd7fc6cbd7ec4ca514e17a70c4) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/wavpack.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/wavpack.c b/libavcodec/wavpack.c
index c98f8142a9..acfcb5aa72 100644
--- a/libavcodec/wavpack.c
+++ b/libavcodec/wavpack.c
@@ -474,7 +474,7 @@ static inline int wv_unpack_stereo(WavpackFrameContext *s, GetBitContext *gb,
}
if (type == AV_SAMPLE_FMT_S16P) {
- if (FFABS(L) + (unsigned)FFABS(R) > (1<<19)) {
+ if (FFABS((int64_t)L) + FFABS((int64_t)R) > (1<<19)) {
av_log(s->avctx, AV_LOG_ERROR, "sample %d %d too large\n", L, R);
return AVERROR_INVALIDDATA;
}