mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-16 21:14:44 +00:00
srtobject: check for null local address to avoid SIGSEV
This commit is contained in:
parent
daaa1c3aa8
commit
b9f070f796
1 changed files with 5 additions and 4 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue