Commit 2f8f014d authored by Tim-Philipp Müller's avatar Tim-Philipp Müller

ffmpegmux: don't leak caps if type already exists

We don't know if gst_element_register() will replace the known type
or reject it, so we really need to free the caps before.
parent 048b0145
......@@ -861,16 +861,17 @@ gst_ffmpegmux_register (GstPlugin * plugin)
type = g_type_register_static (GST_TYPE_ELEMENT, type_name, &typeinfo, 0);
g_type_set_qdata (type, GST_FFMUX_PARAMS_QDATA, (gpointer) params);
g_type_add_interface_static (type, GST_TYPE_TAG_SETTER, &tag_setter_info);
} else {
gst_caps_replace (&srccaps, NULL);
gst_caps_replace (&audiosinkcaps, NULL);
gst_caps_replace (&videosinkcaps, NULL);
}
if (!gst_element_register (plugin, type_name, GST_RANK_NONE, type)) {
g_free (type_name);
gst_caps_unref (srccaps);
if (audiosinkcaps)
gst_caps_unref (audiosinkcaps);
if (videosinkcaps)
gst_caps_unref (videosinkcaps);
gst_caps_replace (&srccaps, NULL);
gst_caps_replace (&audiosinkcaps, NULL);
gst_caps_replace (&videosinkcaps, NULL);
return FALSE;
}
......
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