rtmp2sink: fix crash if message conversion failed
authorGuillaume Desmottes <guillaume.desmottes@onestream.live>
Fri, 18 Aug 2023 07:27:36 +0000 (09:27 +0200)
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Fri, 18 Aug 2023 14:04:14 +0000 (14:04 +0000)
The message pointer is not set so we can't display it in logs.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5202>

subprojects/gst-plugins-bad/gst/rtmp2/gstrtmp2sink.c

index c93246e..f39bc43 100644 (file)
@@ -821,7 +821,7 @@ static GstFlowReturn
 gst_rtmp2_sink_render (GstBaseSink * sink, GstBuffer * buffer)
 {
   GstRtmp2Sink *self = GST_RTMP2_SINK (sink);
-  GstBuffer *message;
+  GstBuffer *message = NULL;
   GstFlowReturn ret;
 
   if (G_UNLIKELY (should_drop_header (self, buffer))) {
@@ -833,7 +833,7 @@ gst_rtmp2_sink_render (GstBaseSink * sink, GstBuffer * buffer)
 
   if (G_UNLIKELY (!buffer_to_message (self, buffer, &message))) {
     GST_ELEMENT_ERROR (self, STREAM, FAILED, ("Failed to convert FLV to RTMP"),
-        ("Failed to convert %" GST_PTR_FORMAT, message));
+        ("Failed to convert %" GST_PTR_FORMAT, buffer));
     return GST_FLOW_ERROR;
   }