diff options
author | Damiano Galassi <[email protected]> | 2019-12-19 14:37:40 +0100 |
---|---|---|
committer | Bradley Sepos <[email protected]> | 2019-12-19 14:32:27 -0500 |
commit | fb0e01aeeb0517bf0b1923c0109887330635dd14 (patch) | |
tree | 9e39db2ca383cb88ba6794ae94e0dd4ec8a58100 | |
parent | 9c6e623403e7f159c5cb53f8326de90df2adf424 (diff) |
dvdnav: check pgcn validity before starting a pgc walk.
(cherry picked from commit c76baf650f2dbbe201453429fa4da74c5178632f)
-rw-r--r-- | libhb/dvdnav.c | 6 |
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(); |