[DVDnav-discuss] r1258 - trunk/libdvdread/src/ifo_read.c

rathann subversion at mplayerhq.hu
Thu Oct 3 23:57:48 CEST 2013


Author: rathann
Date: Thu Oct  3 23:57:48 2013
New Revision: 1258

Log:
If the start offset points past the last_byte (outside the region read) stop
reading PTTs and adjust nr_of_srpts.

Fixes Transformers 3 and Cars 2.

Patch by John Stebbins ^stebbins*jetheaddev+com/

Modified:
   trunk/libdvdread/src/ifo_read.c

Modified: trunk/libdvdread/src/ifo_read.c
==============================================================================
--- trunk/libdvdread/src/ifo_read.c	Sun Apr 28 21:10:07 2013	(r1257)
+++ trunk/libdvdread/src/ifo_read.c	Thu Oct  3 23:57:48 2013	(r1258)
@@ -1185,7 +1185,15 @@ int ifoRead_VTS_PTT_SRPT(ifo_handle_t *i
     goto fail;
   }
   for(i = 0; i < vts_ptt_srpt->nr_of_srpts; i++) {
-    B2N_32(data[i]);
+    /* Transformers 3 has PTT start bytes that point outside the SRPT PTT */
+    uint32_t start = data[i];
+    B2N_32(start);
+    if(start + sizeof(ptt_info_t) > vts_ptt_srpt->last_byte + 1) {
+      /* don't mess with any bytes beyond the end of the allocation */
+      vts_ptt_srpt->nr_of_srpts = i;
+      break;
+    }
+    data[i] = start;
     /* assert(data[i] + sizeof(ptt_info_t) <= vts_ptt_srpt->last_byte + 1);
        Magic Knight Rayearth Daybreak is mastered very strange and has
        Titles with 0 PTTs. They all have a data[i] offsets beyond the end of


More information about the DVDnav-discuss mailing list