You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-07-11 14:30:22 +02:00
avformat/jacosubdec: Check for min in t overflow in get_shift()
Fixes: negation of -2147483648 cannot be represented in type 'int'; cast to an unsigned type to negate this value to itself
Fixes: 34651/clusterfuzz-testcase-minimized-ffmpeg_dem_JACOSUB_fuzzer-5157941012463616
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 989febfbd0
)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
@ -141,6 +141,9 @@ static int get_shift(int timeres, const char *buf)
|
|||||||
int n = sscanf(buf, "%d"SSEP"%d"SSEP"%d"SSEP"%d", &a, &b, &c, &d);
|
int n = sscanf(buf, "%d"SSEP"%d"SSEP"%d"SSEP"%d", &a, &b, &c, &d);
|
||||||
#undef SSEP
|
#undef SSEP
|
||||||
|
|
||||||
|
if (a == INT_MIN)
|
||||||
|
return 0;
|
||||||
|
|
||||||
if (*buf == '-' || a < 0) {
|
if (*buf == '-' || a < 0) {
|
||||||
sign = -1;
|
sign = -1;
|
||||||
a = FFABS(a);
|
a = FFABS(a);
|
||||||
|
Reference in New Issue
Block a user