diff --git a/sys/decklink/gstdecklink.cpp b/sys/decklink/gstdecklink.cpp index b561316920..94698a6893 100644 --- a/sys/decklink/gstdecklink.cpp +++ b/sys/decklink/gstdecklink.cpp @@ -1286,6 +1286,9 @@ gst_decklink_acquire_nth_output (gint n, GstElement * sink, gboolean is_audio) g_once (&devices_once, init_devices, NULL); + if (devices == NULL) + return NULL; + if (n < 0 || (guint) n >= devices->len) return NULL; @@ -1318,6 +1321,9 @@ gst_decklink_release_nth_output (gint n, GstElement * sink, gboolean is_audio) GstDecklinkOutput *output; Device *device; + if (devices == NULL) + return; + if (n < 0 || (guint) n >= devices->len) return; @@ -1346,6 +1352,9 @@ gst_decklink_acquire_nth_input (gint n, GstElement * src, gboolean is_audio) g_once (&devices_once, init_devices, NULL); + if (devices == NULL) + return NULL; + if (n < 0 || (guint) n >= devices->len) return NULL; @@ -1380,6 +1389,9 @@ gst_decklink_release_nth_input (gint n, GstElement * src, gboolean is_audio) GstDecklinkInput *input; Device *device; + if (devices == NULL) + return; + if (n < 0 || (guint) n >= devices->len) return;