# HG changeset patch # User reimar # Date 1393183043 0 # Node ID c3809c28a4e079af21f714f637d8162a3d883b92 # Parent e6823a005ab6c25cf6ff19795a2a56990d515e7c Add additional sanity checks. diff -r e6823a005ab6 -r c3809c28a4e0 stream/stream_dvd.c --- 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; ivts_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;