[vlc-commits] DVDNav: fix dvdnav_describe_title_chapters crash

Jean-Baptiste Kempf git at videolan.org
Thu Aug 9 15:51:17 CEST 2012


vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Thu Aug  9 15:50:12 2012 +0200| [ff208b73f4a9d5913cc7f4b170a98945d620b638] | committer: Jean-Baptiste Kempf

DVDNav: fix dvdnav_describe_title_chapters crash

Close #6578

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=ff208b73f4a9d5913cc7f4b170a98945d620b638
---

 ...nav-searching.c-check-cellnr-before-indexing.patch |   17 +++++++++++++++++
 contrib/src/dvdnav/rules.mak                          |    1 +
 2 files changed, 18 insertions(+)

diff --git a/contrib/src/dvdnav/libdvdnav-searching.c-check-cellnr-before-indexing.patch b/contrib/src/dvdnav/libdvdnav-searching.c-check-cellnr-before-indexing.patch
new file mode 100644
index 0000000..92f5494
--- /dev/null
+++ b/contrib/src/dvdnav/libdvdnav-searching.c-check-cellnr-before-indexing.patch
@@ -0,0 +1,17 @@
+diff --git a/src/searching.c b/src/searching.c
+index 3649e9d..0b5f22a 100644
+--- a/src/searching.c
++++ b/src/searching.c
+@@ -640,7 +640,11 @@ uint32_t dvdnav_describe_title_chapters(dvdnav_t *this, int32_t title, uint64_t
+       goto fail;
+     }
+ 
+-    cellnr = pgc->program_map[ptt[i].pgn-1];
++    if ((cellnr = pgc->program_map[ptt[i].pgn-1]) == 0) {
++      printerr("Cell new row cannot be 0");
++      continue;
++    }
++
+     if(ptt[i].pgn < pgc->nr_of_programs)
+       endcellnr = pgc->program_map[ptt[i].pgn];
+     else
diff --git a/contrib/src/dvdnav/rules.mak b/contrib/src/dvdnav/rules.mak
index 2482aed..c58cf3a 100644
--- a/contrib/src/dvdnav/rules.mak
+++ b/contrib/src/dvdnav/rules.mak
@@ -18,6 +18,7 @@ $(TARBALLS)/libdvdnav-$(LIBDVDNAV_VERSION).tar.bz2:
 dvdnav: libdvdnav-$(LIBDVDNAV_VERSION).tar.bz2 .sum-dvdnav
 	$(UNPACK)
 	$(APPLY) $(SRC)/dvdnav/dvdnav.patch
+	$(APPLY) $(SRC)/dvdnav/libdvdnav-searching.c-check-cellnr-before-indexing.patch
 	$(MOVE)
 
 DEPS_dvdnav = dvdcss dvdread



More information about the vlc-commits mailing list