mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-24 09:10:36 +00:00
discoverer: fix GstToc leak when parsing toc messages
gst_message_parse_toc() returns a reffed GstToc which is owned by the GstDiscovererInfo. But we have to make sure we unref its previous value before setting the new one. https://bugzilla.gnome.org/show_bug.cgi?id=747103
This commit is contained in:
parent
ebf8ea4ed9
commit
d7d8fc5652
1 changed files with 3 additions and 1 deletions
|
@ -1423,7 +1423,9 @@ handle_message (GstDiscoverer * dc, GstMessage * msg)
|
||||||
|
|
||||||
gst_message_parse_toc (msg, &tmp, NULL);
|
gst_message_parse_toc (msg, &tmp, NULL);
|
||||||
GST_DEBUG_OBJECT (GST_MESSAGE_SRC (msg), "Got toc %" GST_PTR_FORMAT, tmp);
|
GST_DEBUG_OBJECT (GST_MESSAGE_SRC (msg), "Got toc %" GST_PTR_FORMAT, tmp);
|
||||||
dc->priv->current_info->toc = tmp;
|
if (dc->priv->current_info->toc)
|
||||||
|
gst_toc_unref (dc->priv->current_info->toc);
|
||||||
|
dc->priv->current_info->toc = tmp; /* transfer ownership */
|
||||||
GST_DEBUG_OBJECT (GST_MESSAGE_SRC (msg), "Current info %p, toc %"
|
GST_DEBUG_OBJECT (GST_MESSAGE_SRC (msg), "Current info %p, toc %"
|
||||||
GST_PTR_FORMAT, dc->priv->current_info, tmp);
|
GST_PTR_FORMAT, dc->priv->current_info, tmp);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue