From e8920a6f5fbbceef8ea8b430ea082c9688ac58fc Mon Sep 17 00:00:00 2001
From: Fabian Keil <fk@fabiankeil.de>
Date: Sat, 14 Jul 2012 00:13:19 +0200
Subject: [PATCH 3/3] Let dvdnav_describe_title_chapters() skip PGCs with a
 cell number of zero

In this case pgc->program_map can be invalid and
accessing it results in a core dump due to SIGBUS.
---
 src/searching.c |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/searching.c b/src/searching.c
index 96c5c7f..4c3fb2f 100644
--- a/src/searching.c
+++ b/src/searching.c
@@ -630,6 +630,10 @@ uint32_t dvdnav_describe_title_chapters(dvdnav_t *this, int32_t title, uint64_t
       goto fail;
     }
 
+    if (pgc->nr_of_cells == 0) {
+      printerr("Number of cells cannot be 0");
+      continue;
+    }
     if ((cellnr = pgc->program_map[ptt[i].pgn-1]) == 0) {
       printerr("Cell new row cannot be 0");
       continue;
-- 
1.7.10.3

