changeset 28191:a39df27439b9

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.
author reimar
date Thu, 01 Jan 2009 11:46:34 +0000
parents 321b70afabe1
children bc49998d5745
files stream/stream_dvd.c
diffstat 1 files changed, 9 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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;