From 82d097d04bf08ec28444709569f6d65347d2ac0f Mon Sep 17 00:00:00 2001 From: reimar Date: Thu, 1 Jan 2009 11:46:34 +0000 Subject: Fix DVD seek_to_chapter: the title number must be converted to a per-VTS title number first. Also add a few out-of-bounds checks just in case. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28226 b3059339-0415-0410-9bf9-f77b7e298cf2 --- stream/stream_dvd.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'stream/stream_dvd.c') diff --git a/stream/stream_dvd.c b/stream/stream_dvd.c index 235586597a..ae07239ad5 100644 --- a/stream/stream_dvd.c +++ b/stream/stream_dvd.c @@ -570,6 +570,15 @@ static int seek_to_chapter(stream_t *stream, ifo_handle_t *vts_file, tt_srpt_t * if(!vts_file || !tt_srpt) return 0; + if(title_no < 0 || title_no >= tt_srpt->nr_of_srpts) + return 0; + + // map global title to vts title + title_no = tt_srpt->title[title_no].vts_ttn - 1; + + if(title_no < 0 || title_no >= vts_file->vts_ptt_srpt->nr_of_srpts) + return 0; + if(chapter < 0 || chapter > vts_file->vts_ptt_srpt->title[title_no].nr_of_ptts-1) //no such chapter return 0; -- cgit v1.2.3