[libbluray-devel] check for null

hpi1 git at videolan.org
Wed Oct 22 13:55:42 CEST 2014


libbluray | branch: master | hpi1 <hpi1 at anonymous.org> | Tue Oct 21 14:22:24 2014 +0300| [0165bfaec0a2f47d65aa02ad11ed3546a7731b38] | committer: hpi1

check for null

> http://git.videolan.org/gitweb.cgi/libbluray.git/?a=commit;h=0165bfaec0a2f47d65aa02ad11ed3546a7731b38
---

 src/libbluray/bluray.c |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/libbluray/bluray.c b/src/libbluray/bluray.c
index d346181..f6e289e 100644
--- a/src/libbluray/bluray.c
+++ b/src/libbluray/bluray.c
@@ -2949,6 +2949,11 @@ static int _play_hdmv(BLURAY *bd, unsigned id_ref)
 
 static int _play_title(BLURAY *bd, unsigned title)
 {
+    if (!bd->disc_info.titles) {
+        BD_DEBUG(DBG_BLURAY | DBG_CRIT, "_play_title(#%d): No disc index\n", title);
+        return 0;
+    }
+
     /* first play object ? */
     if (title == BLURAY_TITLE_FIRST_PLAY) {
 
@@ -3461,7 +3466,7 @@ const struct meta_dl *bd_get_meta(BLURAY *bd)
     }
 
     /* assign title names to disc_info */
-    if (meta) {
+    if (meta && bd->titles) {
         unsigned ii;
         for (ii = 0; ii < meta->toc_count; ii++) {
             if (meta->toc_entries[ii].title_number > 0 && meta->toc_entries[ii].title_number <= bd->disc_info.num_titles) {



More information about the libbluray-devel mailing list