# HG changeset patch # User reimar # Date 1230810394 0 # Node ID a39df27439b9a54b7d8ba5a8f4e938764fa02784 # Parent 321b70afabe1ae11494cfc9e4a4d4796b716a1d7 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. diff -r 321b70afabe1 -r a39df27439b9 stream/stream_dvd.c --- a/stream/stream_dvd.c Thu Jan 01 11:41:09 2009 +0000 +++ b/stream/stream_dvd.c Thu Jan 01 11:46:34 2009 +0000 @@ -570,6 +570,15 @@ 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;