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>
(cherry picked from commit 746203af31)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Michael Niedermayer 2024-03-26 00:21:28 +01:00
parent 0a64d77be9
commit 6cc785c255
No known key found for this signature in database
GPG Key ID: B18E8928B3948D64
1 changed files with 1 additions and 1 deletions

View File

@ -149,7 +149,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);