aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2021-06-03 22:26:41 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2021-09-13 22:48:10 +0200
commit989febfbd0c986e9e3e0f269a6b22778bf79147b (patch)
tree6bd47ae872047d8ab840554a10aa391ff11016c3 /libavformat
parent3dd5a8a13510d08a4e25e8f138d718672a0fed4a (diff)
downloadffmpeg-989febfbd0c986e9e3e0f269a6b22778bf79147b.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>
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/jacosubdec.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libavformat/jacosubdec.c b/libavformat/jacosubdec.c
index 8cb918ccee..68ed7511d7 100644
--- a/libavformat/jacosubdec.c
+++ b/libavformat/jacosubdec.c
@@ -134,6 +134,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);