From 429fe85c4827035cab5dea163e427630d8b4f93f Mon Sep 17 00:00:00 2001 From: wm4 Date: Sat, 6 Dec 2014 13:47:03 +0100 Subject: demux_mkv: reject 0 TimecodeScale Also reject anything over INT_MAX; no particular reason for this upper bound. Fixes #1317. --- demux/demux_mkv.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'demux') diff --git a/demux/demux_mkv.c b/demux/demux_mkv.c index 6d2e16df1c..2a0f5c08b3 100644 --- a/demux/demux_mkv.c +++ b/demux/demux_mkv.c @@ -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; -- cgit v1.2.3