mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 05:06:17 +00:00
splitmux: fix memory leak
If execution goes to the beach in line 981, buf_info goes out of scope without the memory being free'd. Handle this case. CID #1268403
This commit is contained in:
parent
603c1d71a1
commit
0373fd8f65
1 changed files with 6 additions and 2 deletions
|
@ -909,7 +909,7 @@ handle_mq_input (GstPad * pad, GstPadProbeInfo * info, MqStreamCtx * ctx)
|
||||||
{
|
{
|
||||||
GstSplitMuxSink *splitmux = ctx->splitmux;
|
GstSplitMuxSink *splitmux = ctx->splitmux;
|
||||||
GstBuffer *buf;
|
GstBuffer *buf;
|
||||||
MqStreamBuf *buf_info;
|
MqStreamBuf *buf_info = NULL;
|
||||||
GstClockTime ts;
|
GstClockTime ts;
|
||||||
gboolean loop_again;
|
gboolean loop_again;
|
||||||
gboolean keyframe = FALSE;
|
gboolean keyframe = FALSE;
|
||||||
|
@ -1090,9 +1090,13 @@ handle_mq_input (GstPad * pad, GstPadProbeInfo * info, MqStreamCtx * ctx)
|
||||||
GST_LOG_OBJECT (pad, "Returning to queue buffer %" GST_PTR_FORMAT
|
GST_LOG_OBJECT (pad, "Returning to queue buffer %" GST_PTR_FORMAT
|
||||||
" run ts %" GST_TIME_FORMAT, buf, GST_TIME_ARGS (ctx->in_running_time));
|
" run ts %" GST_TIME_FORMAT, buf, GST_TIME_ARGS (ctx->in_running_time));
|
||||||
|
|
||||||
|
GST_SPLITMUX_UNLOCK (splitmux);
|
||||||
|
return GST_PAD_PROBE_PASS;
|
||||||
|
|
||||||
beach:
|
beach:
|
||||||
GST_SPLITMUX_UNLOCK (splitmux);
|
GST_SPLITMUX_UNLOCK (splitmux);
|
||||||
|
if (buf_info)
|
||||||
|
mq_stream_buf_free (buf_info);
|
||||||
return GST_PAD_PROBE_PASS;
|
return GST_PAD_PROBE_PASS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue