mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-24 01:00:37 +00:00
gdpdepay: don't use allocator if it has custom alloc
gdpdepay element uses the decide_allocation to fetch the downstream allocator. Nonetheless it is possible that allocate uses a custom alloc function, which is not usable by gdpdepay, crashing later the application when the allocater buffer is NULL. This patch checks for the allocator flags and reset it if the allocator has a custom alloc function. https://bugzilla.gnome.org/show_bug.cgi?id=789476
This commit is contained in:
parent
f04b20e59e
commit
f6cb16ab8c
1 changed files with 9 additions and 0 deletions
|
@ -580,6 +580,15 @@ gst_gdp_depay_decide_allocation (GstGDPDepay * gdpdepay)
|
|||
if (gdpdepay->allocator)
|
||||
gst_object_unref (gdpdepay->allocator);
|
||||
|
||||
if (allocator &&
|
||||
GST_OBJECT_FLAG_IS_SET (allocator, GST_ALLOCATOR_FLAG_CUSTOM_ALLOC)) {
|
||||
GST_DEBUG_OBJECT (gdpdepay,
|
||||
"Provided allocator has a custom alloc fuction. Ignoring.");
|
||||
gst_object_unref (allocator);
|
||||
allocator = NULL;
|
||||
gst_allocation_params_init (¶ms);
|
||||
}
|
||||
|
||||
gdpdepay->allocator = allocator;
|
||||
gdpdepay->allocation_params = params;
|
||||
|
||||
|
|
Loading…
Reference in a new issue