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
This commit is contained in:
reimar 2009-01-01 11:46:34 +00:00
parent c1b27dd874
commit 82d097d04b
1 changed files with 9 additions and 0 deletions

View File

@ -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) if(!vts_file || !tt_srpt)
return 0; 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 if(chapter < 0 || chapter > vts_file->vts_ptt_srpt->title[title_no].nr_of_ptts-1) //no such chapter
return 0; return 0;