[DVDnav-discuss] r1261 - trunk/libdvdnav/src/searching.c

rathann subversion at mplayerhq.hu
Fri Oct 4 00:21:29 CEST 2013


Author: rathann
Date: Fri Oct  4 00:21:29 2013
New Revision: 1261

Log:
This is a heuristic to prevent segfaults when
 ifo->vts_pgcit->pgci_srp[ptt[i].pgcn-1].pgc is invalid
 but non-NULL.

Patch by Fabian Keil #fk$fabiankeil%de^

Modified:
   trunk/libdvdnav/src/searching.c

Modified: trunk/libdvdnav/src/searching.c
==============================================================================
--- trunk/libdvdnav/src/searching.c	Fri Oct  4 00:19:25 2013	(r1260)
+++ trunk/libdvdnav/src/searching.c	Fri Oct  4 00:21:29 2013	(r1261)
@@ -616,6 +616,10 @@ uint32_t dvdnav_describe_title_chapters(
   length = 0;
   for(i=0; i<parts; i++) {
     uint32_t cellnr, endcellnr;
+    if (ifo->vts_pgcit->pgci_srp[ptt[i].pgcn-1].pgc_start_byte >= ifo->vts_pgcit->last_byte) {
+      printerr("PGC start out of bounds");
+      continue;
+    }
     pgc = ifo->vts_pgcit->pgci_srp[ptt[i].pgcn-1].pgc;
     if (pgc == NULL) {
       printerr("PGC missing.");


More information about the DVDnav-discuss mailing list