splitmuxsink: Fix memory leak

Fix a leak of the buffer info struct when reaching
EOS without data on the reference input.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2751>
This commit is contained in:
Jan Schmidt 2022-07-12 21:19:35 +10:00 committed by GStreamer Marge Bot
parent ebd8bd8f13
commit ab459f0528

View file

@ -3202,9 +3202,7 @@ handle_mq_input (GstPad * pad, GstPadProbeInfo * info, MqStreamCtx * ctx)
if (g_queue_is_empty (&splitmux->pending_input_gops)) {
GST_WARNING_OBJECT (pad,
"Reference was closed without GOP, dropping");
GST_SPLITMUX_UNLOCK (splitmux);
GST_PAD_PROBE_INFO_FLOW_RETURN (info) = GST_FLOW_EOS;
return GST_PAD_PROBE_DROP;
goto drop;
}
check_completed_gop (splitmux, ctx);
@ -3255,6 +3253,12 @@ beach:
mq_stream_buf_free (buf_info);
GST_PAD_PROBE_INFO_FLOW_RETURN (info) = ret;
return GST_PAD_PROBE_PASS;
drop:
GST_SPLITMUX_UNLOCK (splitmux);
if (buf_info)
mq_stream_buf_free (buf_info);
GST_PAD_PROBE_INFO_FLOW_RETURN (info) = GST_FLOW_EOS;
return GST_PAD_PROBE_DROP;
}
static void