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:
wm4 2014-12-06 13:47:03 +01:00
parent 73b7d4516b
commit 429fe85c48
1 changed files with 4 additions and 0 deletions

View File

@ -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;