1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-01-13 21:28:01 +02:00

avformat/jacosubdec: Check timeres

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Michael Niedermayer 2023-09-30 19:59:06 +02:00
parent 32447b149f
commit 51f0ab8b12
No known key found for this signature in database
GPG Key ID: B18E8928B3948D64

View File

@ -227,15 +227,18 @@ static int jacosub_read_header(AVFormatContext *s)
} }
av_bprintf(&header, "#S %s", p); av_bprintf(&header, "#S %s", p);
break; break;
case 'T': // ...but must be placed after TIMERES case 'T': { // ...but must be placed after TIMERES
jacosub->timeres = strtol(p, NULL, 10); int64_t timeres = strtol(p, NULL, 10);
if (!jacosub->timeres) if (timeres <= 0 || timeres > UINT32_MAX) {
jacosub->timeres = 30; jacosub->timeres = 30;
else } else {
jacosub->timeres = timeres;
av_bprintf(&header, "#T %s", p); av_bprintf(&header, "#T %s", p);
}
break; break;
} }
} }
}
/* general/essential directives in the extradata */ /* general/essential directives in the extradata */
ret = ff_bprint_to_codecpar_extradata(st->codecpar, &header); ret = ff_bprint_to_codecpar_extradata(st->codecpar, &header);