changeset 36812:e6823a005ab6

Add some extra checks to avoid potential crashes. Should avoid the issues described in #2127.
author reimar
date Sun, 23 Feb 2014 19:09:08 +0000
parents 92dd1764392a
children c3809c28a4e0
files stream/stream_dvd.c
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/stream/stream_dvd.c	Sun Feb 23 18:14:44 2014 +0000
+++ b/stream/stream_dvd.c	Sun Feb 23 19:09:08 2014 +0000
@@ -509,6 +509,8 @@
     unsigned int t=0;
     ptt_info_t *ptt;
     pgc_t *pgc;
+    if (!mp_msg_test(MSGT_IDENTIFY, MSGL_INFO))
+        return;
 
     title_no = tt_srpt->title[title_no].vts_ttn - 1;
     if(vts_file->vts_ptt_srpt->title[title_no].nr_of_ptts < 2)
@@ -519,6 +521,8 @@
     for(i=0; i<vts_file->vts_ptt_srpt->title[title_no].nr_of_ptts; i++)
     {
         pgc = vts_file->vts_pgcit->pgci_srp[ptt[i].pgcn-1].pgc;
+        if (!pgc)
+            continue;
         cell = pgc->program_map[ptt[i].pgn-1]; //here the cell is 1-based
         if(ptt[i].pgn<pgc->nr_of_programs)
             last_cell = pgc->program_map[ptt[i].pgn];