aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2024-03-26 00:21:28 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2024-03-26 23:25:36 +0100
commit746203af3116288b1dd4442e46a5724ba759e831 (patch)
tree00977e93b181c850bcfde2db23dd32b152f46261
parent007486058c2eb7a7518450a2ddb4fa98845887a3 (diff)
downloadffmpeg-746203af3116288b1dd4442e46a5724ba759e831.tar.gz
avformat/jacosubdec: Use 64bit for abs
Fixes: negation of -2147483648 cannot be represented in type 'int'; cast to an unsigned type to negate this value to itself Fixes: 62276/clusterfuzz-testcase-minimized-ffmpeg_dem_JACOSUB_fuzzer-5401294942371840 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavformat/jacosubdec.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/jacosubdec.c b/libavformat/jacosubdec.c
index 3a42c4b03e..da150a96ab 100644
--- a/libavformat/jacosubdec.c
+++ b/libavformat/jacosubdec.c
@@ -150,7 +150,7 @@ static int get_shift(unsigned timeres, const char *buf)
}
ret = (int64_t)h*3600 + (int64_t)m*60 + s;
- if (FFABS(ret) > (INT64_MAX - FFABS(d)) / timeres)
+ if (FFABS(ret) > (INT64_MAX - FFABS((int64_t)d)) / timeres)
return 0;
ret = sign * (ret * timeres + d);