[vlc-commits] [Git][videolan/vlc][master] contrib: dvdnav: fix some mismatched reference index/available elements
Felix Paul Kühne (@fkuehne)
gitlab at videolan.org
Fri May 23 13:05:49 UTC 2025
Felix Paul Kühne pushed to branch master at VideoLAN / VLC
Commits:
ae87cc1d by Steve Lhomme at 2025-05-23T12:21:43+00:00
contrib: dvdnav: fix some mismatched reference index/available elements
- - - - -
3 changed files:
- + contrib/src/dvdnav/0001-Check-the-the-title-parts-read-are-available.patch
- + contrib/src/dvdnav/0002-Fix-access-to-title-not-found-in-array.patch
- contrib/src/dvdnav/rules.mak
Changes:
=====================================
contrib/src/dvdnav/0001-Check-the-the-title-parts-read-are-available.patch
=====================================
@@ -0,0 +1,29 @@
+From e10f8570219748f67c7809cbdb57e8b790415083 Mon Sep 17 00:00:00 2001
+From: Steve Lhomme <robux4 at ycbcr.xyz>
+Date: Thu, 22 May 2025 13:57:31 +0200
+Subject: [PATCH 1/2] Check the the title parts read are available
+
+The nr_of_ptts of the VTS and VMGI may differ.
+We can't read past the number count of items in title[].
+---
+ src/searching.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/src/searching.c b/src/searching.c
+index 7c8e6e6..ba27306 100644
+--- a/src/searching.c
++++ b/src/searching.c
+@@ -668,6 +668,10 @@ uint32_t dvdnav_describe_title_chapters(dvdnav_t *this, int32_t title, uint64_t
+ if(ptitle->vts_ttn == 0)
+ goto fail;
+ ptt = ifo->vts_ptt_srpt->title[ptitle->vts_ttn-1].ptt;
++ if (parts >= ifo->vts_ptt_srpt->title[ptitle->vts_ttn-1].nr_of_ptts) {
++ printerr("Too many parts, using the ones available.");
++ parts = ifo->vts_ptt_srpt->title[ptitle->vts_ttn-1].nr_of_ptts;
++ }
+
+ tmp = calloc(1, sizeof(uint64_t)*parts);
+ if(!tmp)
+--
+2.45.1.windows.1
+
=====================================
contrib/src/dvdnav/0002-Fix-access-to-title-not-found-in-array.patch
=====================================
@@ -0,0 +1,27 @@
+From 48ba3c481225dbe3b3a03ed621bed8df25bed941 Mon Sep 17 00:00:00 2001
+From: Steve Lhomme <robux4 at ycbcr.xyz>
+Date: Thu, 22 May 2025 14:09:53 +0200
+Subject: [PATCH 2/2] Fix access to title not found in array
+
+---
+ src/searching.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/src/searching.c b/src/searching.c
+index ba27306..968deef 100644
+--- a/src/searching.c
++++ b/src/searching.c
+@@ -667,6 +667,10 @@ uint32_t dvdnav_describe_title_chapters(dvdnav_t *this, int32_t title, uint64_t
+ parts = ptitle->nr_of_ptts;
+ if(ptitle->vts_ttn == 0)
+ goto fail;
++ if (ptitle->vts_ttn > ifo->vts_ptt_srpt->nr_of_srpts) {
++ printerr("Requested title not found.");
++ goto fail;
++ }
+ ptt = ifo->vts_ptt_srpt->title[ptitle->vts_ttn-1].ptt;
+ if (parts >= ifo->vts_ptt_srpt->title[ptitle->vts_ttn-1].nr_of_ptts) {
+ printerr("Too many parts, using the ones available.");
+--
+2.45.1.windows.1
+
=====================================
contrib/src/dvdnav/rules.mak
=====================================
@@ -25,6 +25,9 @@ dvdnav: libdvdnav-$(LIBDVDNAV_VERSION).tar.bz2 .sum-dvdnav
# turn asserts/exit into silent discard
$(APPLY) $(SRC)/dvdnav/0001-play-avoid-assert-and-exit-and-bogus-PG-link.patch
$(APPLY) $(SRC)/dvdnav/0002-play-avoid-assert-and-exit-and-bogus-Cell-link.patch
+ # fix some bogus accesses
+ $(APPLY) $(SRC)/dvdnav/0001-Check-the-the-title-parts-read-are-available.patch
+ $(APPLY) $(SRC)/dvdnav/0002-Fix-access-to-title-not-found-in-array.patch
$(call pkg_static,"misc/dvdnav.pc.in")
$(MOVE)
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/ae87cc1de201956333635f0df7f6152ce91bd665
--
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/ae87cc1de201956333635f0df7f6152ce91bd665
You're receiving this email because of your account on code.videolan.org.
VideoLAN code repository instance
More information about the vlc-commits
mailing list