[MPlayer-cvslog] r28226 - trunk/stream/stream_dvd.c

reimar subversion at mplayerhq.hu
Thu Jan 1 12:46:34 CET 2009


Author: reimar
Date: Thu Jan  1 12:46:34 2009
New Revision: 28226

Log:
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.

Modified:
   trunk/stream/stream_dvd.c

Modified: trunk/stream/stream_dvd.c
==============================================================================
--- trunk/stream/stream_dvd.c	Thu Jan  1 12:41:09 2009	(r28225)
+++ trunk/stream/stream_dvd.c	Thu Jan  1 12:46:34 2009	(r28226)
@@ -570,6 +570,15 @@ static int seek_to_chapter(stream_t *str
     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;
 



More information about the MPlayer-cvslog mailing list