aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2022-10-28 23:28:59 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2023-03-27 13:37:12 +0200
commit889a2953849c251d2b8f96a753e0becdc4aa8a2c (patch)
tree6332cc97d1526dc48b57ffafdb285806f6eead63
parent2334da0faac38bf6dbc67b1b1c16891473f208f2 (diff)
downloadffmpeg-889a2953849c251d2b8f96a753e0becdc4aa8a2c.tar.gz
avformat/replaygain: avoid undefined / negative abs
Fixes: signed integer overflow: -2147483648 * 100000 cannot be represented in type 'int' Fixes: 52060/clusterfuzz-testcase-minimized-ffmpeg_dem_MP3_fuzzer-5131616708329472 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 2532b20b17ec557f1b925bfc41c00e7d4e17356c) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavformat/replaygain.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/replaygain.c b/libavformat/replaygain.c
index 24f5c74183..915bcb2382 100644
--- a/libavformat/replaygain.c
+++ b/libavformat/replaygain.c
@@ -60,7 +60,7 @@ static int32_t parse_value(const char *value, int32_t min)
}
}
- if (abs(db) > (INT32_MAX - mb) / 100000)
+ if (llabs(db) > (INT32_MAX - mb) / 100000)
return min;
return db * 100000 + sign * mb;