aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2021-06-03 22:26:41 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2021-10-17 21:34:53 +0200
commit9f352dc52d93399189b6ed86e09a334515f94553 (patch)
tree4d5e019d655c3f6ea14c5d421e64f69d8a0c753b
parentc8174013f2205acf8367392596c75d76d6405271 (diff)
downloadffmpeg-9f352dc52d93399189b6ed86e09a334515f94553.tar.gz
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 989febfbd0c986e9e3e0f269a6b22778bf79147b) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavformat/jacosubdec.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libavformat/jacosubdec.c b/libavformat/jacosubdec.c
index 070d1eeb5f..0dd046d213 100644
--- a/libavformat/jacosubdec.c
+++ b/libavformat/jacosubdec.c
@@ -140,6 +140,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);
#undef SSEP
+ if (a == INT_MIN)
+ return 0;
+
if (*buf == '-' || a < 0) {
sign = -1;
a = FFABS(a);