aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/jacosubdec.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2023-09-30 19:59:06 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2023-10-08 21:36:00 +0200
commit51f0ab8b127282415822959ccad7db95ad749b5d (patch)
treed6be56cd6c1c879f7128b380483d2238042d2ac1 /libavformat/jacosubdec.c
parent32447b149fb61eb48436eddbbb1adf91b70ec5e4 (diff)
downloadffmpeg-51f0ab8b127282415822959ccad7db95ad749b5d.tar.gz
avformat/jacosubdec: Check timeres
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavformat/jacosubdec.c')
-rw-r--r--libavformat/jacosubdec.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/libavformat/jacosubdec.c b/libavformat/jacosubdec.c
index 41216081ee..c6e5b4aa6d 100644
--- a/libavformat/jacosubdec.c
+++ b/libavformat/jacosubdec.c
@@ -227,14 +227,17 @@ static int jacosub_read_header(AVFormatContext *s)
}
av_bprintf(&header, "#S %s", p);
break;
- case 'T': // ...but must be placed after TIMERES
- jacosub->timeres = strtol(p, NULL, 10);
- if (!jacosub->timeres)
+ case 'T': { // ...but must be placed after TIMERES
+ int64_t timeres = strtol(p, NULL, 10);
+ if (timeres <= 0 || timeres > UINT32_MAX) {
jacosub->timeres = 30;
- else
+ } else {
+ jacosub->timeres = timeres;
av_bprintf(&header, "#T %s", p);
+ }
break;
}
+ }
}
/* general/essential directives in the extradata */