mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-24 13:56:33 +02:00
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>
This commit is contained in:
parent
a97335b1b3
commit
4d4656e8cd
@ -480,7 +480,7 @@ static inline int wv_unpack_stereo(WavpackFrameContext *s, GetBitContext *gb,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (type == AV_SAMPLE_FMT_S16P) {
|
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);
|
av_log(s->avctx, AV_LOG_ERROR, "sample %d %d too large\n", L, R);
|
||||||
return AVERROR_INVALIDDATA;
|
return AVERROR_INVALIDDATA;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user