[Bug 692691] Dangling pointer when doing allocation query on a flushing queue
GStreamer (bugzilla.gnome.org)
bugzilla at gnome.org
Tue Jan 29 05:47:38 PST 2013
https://bugzilla.gnome.org/show_bug.cgi?id=692691
GStreamer | gstreamer (core) | 1.x
--- Comment #10 from Alexander Schrab <alexas at axis.com> 2013-01-29 13:47:32 UTC ---
Doing ref/unref won't be a good solution, at least not only doing that. Even
though we correctly unref after a while, I get into new problems when the
callee expects the query to be mutable (ref count == 1). From base source:
...
query = gst_query_new_allocation (caps, TRUE);
if (!gst_pad_peer_query (basesrc->srcpad, query)) {
/* not a problem, just debug a little */
GST_DEBUG_OBJECT (basesrc, "peer ALLOCATION query failed");
}
g_assert (bclass->decide_allocation != NULL);
result = bclass->decide_allocation (basesrc, query);
GST_DEBUG_OBJECT (basesrc, "ALLOCATION (%d) params: %" GST_PTR_FORMAT,
result,
query);
if (!result)
goto no_decide_allocation;
/* we got configuration from our peer or the decide_allocation method,
* parse them */
if (gst_query_get_n_allocation_params (query) > 0) {
gst_query_parse_nth_allocation_param (query, 0, &allocator, ¶ms);
} else {
allocator = NULL;
gst_allocation_params_init (¶ms);
}
...
Here, even though the query fails, we continue to use the query object. Which
should be fine! But the extra ref in the queue is a problem in this case.
--
Configure bugmail: https://bugzilla.gnome.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.
More information about the gstreamer-bugs
mailing list