aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2021-01-31 17:00:38 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2021-09-10 16:04:26 +0200
commitfcbcc75059dbb47691acd3575ab9d0c99b532627 (patch)
tree973cb96c9c1e4bb1f33a1cd8ee102e0a5b93b97f /libavformat
parenta5f24927a761a09a49d5afb9f564ed0a2917dc72 (diff)
downloadffmpeg-fcbcc75059dbb47691acd3575ab9d0c99b532627.tar.gz
avformat/samidec: Sanity check pts
Fixes: signed integer overflow: 0 - -9223372036854775808 cannot be represented in type 'long' Fixes: 29743/clusterfuzz-testcase-minimized-ffmpeg_dem_SAMI_fuzzer-5499256859394048 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 2014b0135293c41d261757bfa1aaba51653bab8e) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/samidec.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavformat/samidec.c b/libavformat/samidec.c
index 3070ef9bac..cf5076c7b8 100644
--- a/libavformat/samidec.c
+++ b/libavformat/samidec.c
@@ -95,6 +95,11 @@ static int sami_read_header(AVFormatContext *s)
const char *p = ff_smil_get_attr_ptr(buf.str, "Start");
sub->pos = pos;
sub->pts = p ? strtol(p, NULL, 10) : 0;
+ if (sub->pts <= INT64_MIN/2 || sub->pts >= INT64_MAX/2) {
+ res = AVERROR_PATCHWELCOME;
+ goto end;
+ }
+
sub->duration = -1;
}
}