aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2017-06-25 00:13:53 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2017-06-25 02:52:41 +0200
commit0fe174fa9c80fdfe681b4b558eeaba96c4b987bd (patch)
tree6f380b3d569790e9725bc59d530be5b3a8a3571e
parent8b9e522e08d91d06dae059a844c2bf20c696a078 (diff)
downloadffmpeg-0fe174fa9c80fdfe681b4b558eeaba96c4b987bd.tar.gz
avcodec/wavpack: Fix integer overflow in wv_unpack_stereo()
Fixes: runtime error: signed integer overflow: 2080374785 + 2080374784 cannot be represented in type 'int' Fixes: 2351/clusterfuzz-testcase-minimized-5359403240783872 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 73ea2a028e12a7d779834f78dc496c8c4b08361f) 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 a4f05f094f..70625548eb 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) + FFABS(R) > (1<<19)) {
+ if (FFABS(L) + (unsigned)FFABS(R) > (1<<19)) {
av_log(s->avctx, AV_LOG_ERROR, "sample %d %d too large\n", L, R);
return AVERROR_INVALIDDATA;
}