mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-08 13:22:53 +02:00
avcodec/apedec: Use NABS to avoid undefined negation
Fixes: negation of -2147483648 cannot be represented in type 'int32_t' (aka 'int'); cast to an unsigned type to negate this value to itself
Fixes: 67738/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_APE_fuzzer-5444313212321792
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 1887ff250c
)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
e37d66a72e
commit
5469ba6d74
@ -1286,7 +1286,7 @@ static void predictor_decode_stereo_3950(APEContext *ctx, int count)
|
||||
int32_t left = a1 - (unsigned)(a0 / 2);
|
||||
int32_t right = left + (unsigned)a0;
|
||||
|
||||
if (FFMAX(FFABS(left), FFABS(right)) > (1<<23)) {
|
||||
if (FFMIN(FFNABS(left), FFNABS(right)) < -(1<<23)) {
|
||||
ctx->interim_mode = !interim_mode;
|
||||
av_log(ctx->avctx, AV_LOG_VERBOSE, "Interim mode: %d\n", ctx->interim_mode);
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user