Commit 10fe0497 authored by Seungha Yang's avatar Seungha Yang Committed by Edward Hervey
Browse files

playback: Fix leak on select_streams

Since gst_event_parse_select_streams() returns newly allocated
memory for stream-id(s), it should be freed explicitly.

https://bugzilla.gnome.org/show_bug.cgi?id=775553
parent b8c78c87
...@@ -2403,8 +2403,10 @@ ghost_pad_event_probe (GstPad * pad, GstPadProbeInfo * info, ...@@ -2403,8 +2403,10 @@ ghost_pad_event_probe (GstPad * pad, GstPadProbeInfo * info,
gst_event_unref (event); gst_event_unref (event);
} }
/* Finally handle the switch */ /* Finally handle the switch */
if (streams) if (streams) {
handle_stream_switch (dbin, streams, seqnum); handle_stream_switch (dbin, streams, seqnum);
g_list_free_full (streams, g_free);
}
ret = GST_PAD_PROBE_HANDLED; ret = GST_PAD_PROBE_HANDLED;
} }
break; break;
...@@ -2450,8 +2452,10 @@ gst_decodebin3_send_event (GstElement * element, GstEvent * event) ...@@ -2450,8 +2452,10 @@ gst_decodebin3_send_event (GstElement * element, GstEvent * event)
} }
#endif #endif
/* Finally handle the switch */ /* Finally handle the switch */
if (streams) if (streams) {
handle_stream_switch (dbin, streams, seqnum); handle_stream_switch (dbin, streams, seqnum);
g_list_free_full (streams, g_free);
}
gst_event_unref (event); gst_event_unref (event);
return TRUE; return TRUE;
......
...@@ -2371,7 +2371,14 @@ update_select_streams_event (GstPlayBin3 * playbin, GstEvent * event) ...@@ -2371,7 +2371,14 @@ update_select_streams_event (GstPlayBin3 * playbin, GstEvent * event)
} }
gst_event_unref (event); gst_event_unref (event);
return gst_event_new_select_streams (to_use); event = gst_event_new_select_streams (to_use);
if (streams)
g_list_free_full (streams, g_free);
if (to_use)
g_list_free_full (to_use, g_free);
return event;
} }
static gboolean static gboolean
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment