summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDamiano Galassi <[email protected]>2019-12-19 14:37:40 +0100
committerBradley Sepos <[email protected]>2019-12-19 14:32:27 -0500
commitfb0e01aeeb0517bf0b1923c0109887330635dd14 (patch)
tree9e39db2ca383cb88ba6794ae94e0dd4ec8a58100
parent9c6e623403e7f159c5cb53f8326de90df2adf424 (diff)
dvdnav: check pgcn validity before starting a pgc walk.
(cherry picked from commit c76baf650f2dbbe201453429fa4da74c5178632f)
-rw-r--r--libhb/dvdnav.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/libhb/dvdnav.c b/libhb/dvdnav.c
index b8c281197..b9ad5cd63 100644
--- a/libhb/dvdnav.c
+++ b/libhb/dvdnav.c
@@ -2087,6 +2087,12 @@ static int TitleOpenIfo(hb_dvdnav_t * d, int t)
}
}
+ /* Check pgc */
+ if ( d->pgcn < 1 || d->pgcn > d->ifo->vts_pgcit->nr_of_pgci_srp || d->pgcn >= MAX_PGCN)
+ {
+ hb_log( "invalid PGC ID %d for title %d, skipping", pgcn, t );
+ goto fail;
+ }
/* Chapters */
d->list_dvd_chapter = hb_list_init();