changeset 36813:c3809c28a4e0

Add additional sanity checks.
author reimar
date Sun, 23 Feb 2014 19:17:23 +0000
parents e6823a005ab6
children b33a9dff0b57
files stream/stream_dvd.c
diffstat 1 files changed, 3 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/stream/stream_dvd.c	Sun Feb 23 19:09:08 2014 +0000
+++ b/stream/stream_dvd.c	Sun Feb 23 19:17:23 2014 +0000
@@ -520,6 +520,9 @@
     mp_msg(MSGT_IDENTIFY, MSGL_INFO, "CHAPTERS: ");
     for(i=0; i<vts_file->vts_ptt_srpt->title[title_no].nr_of_ptts; i++)
     {
+        int pgc_idx = ptt[i].pgcn-1;
+        if (pgc_idx < 0 || pgc_idx >= vts_file->vts_pgcit->nr_of_pgci_srp)
+            continue;
         pgc = vts_file->vts_pgcit->pgci_srp[ptt[i].pgcn-1].pgc;
         if (!pgc)
             continue;