changeset 437:d8ec83537d07 src

Check for out-of-bounds values for pgcn Fixes a crash in dvdnav_describe_title_chapters() with vlc, lsdvd, and other video players caused by an invalid value for pgcn. This occurs with the "Inside Man" DVD. Based on patches by Bryce Harrington <bryce AT canonical DOT com> and Vincent Mussard <frodon AT wanadoo DOT fr>
author rathann
date Tue, 12 Nov 2013 00:55:10 +0000
parents a566d307173d
children 04cb2d6e4f93
files searching.c
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/searching.c	Mon Nov 11 23:49:17 2013 +0000
+++ b/searching.c	Tue Nov 12 00:55:10 2013 +0000
@@ -616,6 +616,10 @@
   length = 0;
   for(i=0; i<parts; i++) {
     uint32_t cellnr, endcellnr;
+    if (ptt[i].pgcn == 0 || ptt[i].pgcn > ifo->vts_pgcit->nr_of_pgci_srp) {
+      printerr("PGCN out of bounds.");
+      continue;
+    }
     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;