summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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;
}
}