rtmp2sink: fix crash if message conversion failed

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>
This commit is contained in:
Guillaume Desmottes 2023-08-18 09:27:36 +02:00 committed by GStreamer Marge Bot
parent d956a7e2d1
commit c98cf346a9

View 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;
}