From 64970e721ff0715d8b435c062675f11d89879da0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= Date: Sat, 4 Jan 2025 12:20:18 +0000 Subject: [PATCH] tcpclientsrc, tcpserversrc: don't try to get stats from NULL socket Fixes criticals during gst-inspect. Wasn't an issue before because the entire stats gathering code path was inactive. Part-of: --- subprojects/gst-plugins-base/gst/tcp/gsttcpclientsrc.c | 3 ++- subprojects/gst-plugins-base/gst/tcp/gsttcpserversrc.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/subprojects/gst-plugins-base/gst/tcp/gsttcpclientsrc.c b/subprojects/gst-plugins-base/gst/tcp/gsttcpclientsrc.c index acb57340aa..abf2b79f4a 100644 --- a/subprojects/gst-plugins-base/gst/tcp/gsttcpclientsrc.c +++ b/subprojects/gst-plugins-base/gst/tcp/gsttcpclientsrc.c @@ -566,7 +566,8 @@ gst_tcp_client_src_get_stats (GstTCPClientSrc * src) s = gst_structure_new ("GstTCPClientSrcStats", "bytes-received", G_TYPE_UINT64, src->bytes_received, NULL); - gst_tcp_stats_from_socket (s, src->socket); + if (src->socket != NULL) + gst_tcp_stats_from_socket (s, src->socket); return s; } diff --git a/subprojects/gst-plugins-base/gst/tcp/gsttcpserversrc.c b/subprojects/gst-plugins-base/gst/tcp/gsttcpserversrc.c index 2e3403bdd7..cc76ffebbc 100644 --- a/subprojects/gst-plugins-base/gst/tcp/gsttcpserversrc.c +++ b/subprojects/gst-plugins-base/gst/tcp/gsttcpserversrc.c @@ -596,7 +596,8 @@ gst_tcp_server_src_get_stats (GstTCPServerSrc * src) s = gst_structure_new ("GstTCPServerSrcStats", "bytes-received", G_TYPE_UINT64, src->bytes_received, NULL); - gst_tcp_stats_from_socket (s, src->client_socket); + if (src->client_socket != NULL) + gst_tcp_stats_from_socket (s, src->client_socket); return s; }