demux_mkv: reject 0 TimecodeScale
Also reject anything over INT_MAX; no particular reason for this upper bound. Fixes #1317.
This commit is contained in:
1 parent
115709e3c1
commit
7c53bb4bb1
1 file changed
+4
@@ -345,6 +345,10 @@ static int demux_mkv_read_info(demuxer_t *demuxer)
|
||||
if (info.n_timecode_scale) {
|
||||
mkv_d->tc_scale = info.timecode_scale;
|
||||
MP_VERBOSE(demuxer, "| + timecode scale: %" PRIu64 "\n", mkv_d->tc_scale);
|
||||
if (mkv_d->tc_scale < 1 || mkv_d->tc_scale > INT_MAX) {
|
||||
res = -1;
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
if (info.n_duration) {
|
||||
mkv_d->duration = info.duration * mkv_d->tc_scale / 1e9;
|
||||
|
||||
Reference in new issue
Block a user