[libbluray-devel] list_titles: check bd_open() result

hpi1 git at videolan.org
Mon Feb 8 10:38:29 CET 2016


libbluray | branch: master | hpi1 <hpi1 at anonymous.org> | Mon Feb  1 11:31:33 2016 +0200| [61117d5a0612fc24ec128f87abf2cbdd354a5759] | committer: hpi1

list_titles: check bd_open() result

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

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

diff --git a/src/examples/list_titles.c b/src/examples/list_titles.c
index 2e0cae8..0194133 100644
--- a/src/examples/list_titles.c
+++ b/src/examples/list_titles.c
@@ -78,7 +78,10 @@ int main(int argc, char *argv[])
         _usage(argv[0]);
     }
     bd = bd_open(bd_dir, NULL);
-
+    if (!bd) {
+        fprintf(stderr, "bd_open(%s) failed\n", bd_dir);
+        exit(EXIT_FAILURE);
+    }
     count = bd_get_titles(bd, flags, seconds);
     main_title = bd_get_main_title(bd);
     if (main_title >= 0) {



More information about the libbluray-devel mailing list