summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAaron Boxer <aaron.boxer@collabora.com>2019-02-20 12:52:08 -0500
committerAaron Boxer <aaron.boxer@collabora.com>2019-02-24 10:50:14 -0500
commitb9f070f7969cb5df83587507b4fff78530b7b69e (patch)
tree96281275246a6e95fad6fe1f3d0cb1a572516cc0
parentdaaa1c3aa8a7edc6aad13f115e380b27e029fc8f (diff)
srtobject: check for null local address to avoid SIGSEV
-rw-r--r--ext/srt/gstsrtobject.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/ext/srt/gstsrtobject.c b/ext/srt/gstsrtobject.c
index dc8ffb64d..f60a56be5 100644
--- a/ext/srt/gstsrtobject.c
+++ b/ext/srt/gstsrtobject.c
@@ -825,6 +825,7 @@ gst_srt_object_connect (GstSRTObject * srtobject,
gint option_val = -1;
gint sock_flags = SRT_EPOLL_ERR;
guint local_port = 0;
+ const gchar *local_address = NULL;
sock = srt_socket (AF_INET, SOCK_DGRAM, 0);
if (sock == SRT_INVALID_SOCK) {
@@ -866,13 +867,13 @@ gst_srt_object_connect (GstSRTObject * srtobject,
}
gst_structure_get_uint (srtobject->parameters, "localport", &local_port);
-
+ local_address =
+ gst_structure_get_string (srtobject->parameters, "localaddress");
/* According to SRT norm, bind local address and port if specified */
- if (local_port != 0) {
+ if (local_address != NULL && local_port != 0) {
gpointer bind_sa;
gsize bind_sa_len;
- const gchar *local_address =
- gst_structure_get_string (srtobject->parameters, "localaddress");
+
GSocketAddress *bind_addr =
g_inet_socket_address_new_from_string (local_address,
local_port);