summaryrefslogtreecommitdiffstats
path: root/stream
diff options
context:
space:
mode:
authorreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2009-01-01 11:46:34 +0000
committerreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2009-01-01 11:46:34 +0000
commit82d097d04bf08ec28444709569f6d65347d2ac0f (patch)
treec8ac0a3274cbdbb6f199fac4860e820ab39698bf /stream
parentc1b27dd8742c97475dccd3d5ffafd2f6bdcba9b6 (diff)
downloadmpv-82d097d04bf08ec28444709569f6d65347d2ac0f.tar.bz2
mpv-82d097d04bf08ec28444709569f6d65347d2ac0f.tar.xz
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
Diffstat (limited to 'stream')
-rw-r--r--stream/stream_dvd.c9
1 files changed, 9 insertions, 0 deletions
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;