aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2020-12-11 01:06:46 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2021-10-09 22:02:20 +0200
commit52022eec69ddf30a500172fe7b3be9f0faa6ada0 (patch)
tree8e5ca1d534c1ee095ec78cdad70d68e9d36c74ad
parent6173ca00f7c4d2a9124f05cb29ac77733a1ed543 (diff)
downloadffmpeg-52022eec69ddf30a500172fe7b3be9f0faa6ada0.tar.gz
avformat/microdvddec: use 64bit for durations
Fixes: signed integer overflow: 7 - -2147483647 cannot be represented in type 'int' Fixes: 28036/clusterfuzz-testcase-minimized-ffmpeg_dem_MICRODVD_fuzzer-5171698751766528 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 f569ac4ce0514bf4e0dd768c5ed007c82548d326) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavformat/microdvddec.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavformat/microdvddec.c b/libavformat/microdvddec.c
index 4ba32fd3d9..ab2a64f1a5 100644
--- a/libavformat/microdvddec.c
+++ b/libavformat/microdvddec.c
@@ -65,12 +65,12 @@ static int64_t get_pts(const char *buf)
return AV_NOPTS_VALUE;
}
-static int get_duration(const char *buf)
+static int64_t get_duration(const char *buf)
{
int frame_start, frame_end;
if (sscanf(buf, "{%d}{%d}", &frame_start, &frame_end) == 2)
- return frame_end - frame_start;
+ return frame_end - (int64_t)frame_start;
return -1;
}