From 2037f1ed0aececc38af8fa81671210f109cda896 Mon Sep 17 00:00:00 2001 From: "Jan Alexander Steffens (heftig)" Date: Wed, 1 Dec 2021 16:11:31 +0100 Subject: [PATCH] rtmp2/client: Make sure 'code' is not NULL Part-of: --- subprojects/gst-plugins-bad/gst/rtmp2/rtmp/rtmpclient.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/subprojects/gst-plugins-bad/gst/rtmp2/rtmp/rtmpclient.c b/subprojects/gst-plugins-bad/gst/rtmp2/rtmp/rtmpclient.c index f743637a64..b5784e52ba 100644 --- a/subprojects/gst-plugins-bad/gst/rtmp2/rtmp/rtmpclient.c +++ b/subprojects/gst-plugins-bad/gst/rtmp2/rtmp/rtmpclient.c @@ -722,15 +722,15 @@ send_connect_done (const gchar * command_name, GPtrArray * args, optional_args = g_ptr_array_index (args, 1); node = gst_amf_node_get_field (optional_args, "code"); - if (!node) { + code = node ? gst_amf_node_peek_string (node, NULL) : NULL; + if (!code) { g_task_return_new_error (task, G_IO_ERROR, G_IO_ERROR_FAILED, "result code missing from connect cmd result"); g_object_unref (task); return; } - code = gst_amf_node_peek_string (node, NULL); - GST_INFO ("connect result: %s", GST_STR_NULL (code)); + GST_INFO ("connect result: %s", code); if (g_str_equal (code, "NetConnection.Connect.Success")) { node = gst_amf_node_get_field (optional_args, "secureToken"); @@ -859,7 +859,7 @@ send_connect_done (const gchar * command_name, GPtrArray * args, } g_task_return_new_error (task, G_IO_ERROR, G_IO_ERROR_FAILED, - "unhandled connect result code: %s", GST_STR_NULL (code)); + "unhandled connect result code: %s", code); g_object_unref (task); }