[libbluray-devel] bd_open(): return NULL if disc root is NULL

hpi1 git at videolan.org
Wed May 13 10:51:22 CEST 2015


libbluray | branch: master | hpi1 <hpi1 at anonymous.org> | Wed May 13 11:45:50 2015 +0300| [ac97f9c02ab9b939712fae5e8798c40952624580] | committer: hpi1

bd_open(): return NULL if disc root is NULL

Fixes crash when disc files are accessed later.

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

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

diff --git a/src/libbluray/bluray.c b/src/libbluray/bluray.c
index 44b354f..eba9c5e 100644
--- a/src/libbluray/bluray.c
+++ b/src/libbluray/bluray.c
@@ -1461,7 +1461,10 @@ BLURAY *bd_open(const char *device_path, const char *keyfile_path)
         return NULL;
     }
 
-    bd_open_disc(bd, device_path, keyfile_path);
+    if (!bd_open_disc(bd, device_path, keyfile_path)) {
+        bd_close(bd);
+        return NULL;
+    }
 
     return bd;
 }



More information about the libbluray-devel mailing list