[vlc-commits] access: bluray: check for input before accessing it

Thomas Guillem git at videolan.org
Mon Jun 19 17:02:48 CEST 2017


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Mon Jun 19 16:59:09 2017 +0200| [6c947b775d4d6c6ed07ebde140bddd3a2007b41a] | committer: Thomas Guillem

access: bluray: check for input before accessing it

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

 modules/access/bluray.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/modules/access/bluray.c b/modules/access/bluray.c
index ffe2d912f2..dc5142fe9b 100644
--- a/modules/access/bluray.c
+++ b/modules/access/bluray.c
@@ -627,6 +627,9 @@ static int blurayOpen(vlc_object_t *object)
     const char *error_msg = NULL;
 #define BLURAY_ERROR(s) do { error_msg = s; goto error; } while(0)
 
+    if (unlikely(!p_demux->p_input))
+        return VLC_EGENERIC;
+
     forced = !strcasecmp(p_demux->psz_access, "bluray");
 
     if (p_demux->s) {
@@ -802,10 +805,6 @@ static int blurayOpen(vlc_object_t *object)
 
     /* Registering overlay event handler */
     bd_register_overlay_proc(p_sys->bluray, p_demux, blurayOverlayProc);
-    if (unlikely(!p_demux->p_input)) {
-        msg_Err(p_demux, "Could not get parent input");
-        goto error;
-    }
 
     if (p_sys->b_menu) {
 



More information about the vlc-commits mailing list