Commit 841781cc authored by Nicolas Dufresne's avatar Nicolas Dufresne Committed by Sebastian Dröge

glmemory: Fix n_wrapped_pointers usage

gst_gl_memory_setup_buffer() was not properly using the number
of pointers to wrapped. This also fixes the validation, as we
only support 1 wrapper per view, or num_planes * views wrapper.

https://bugzilla.gnome.org/show_bug.cgi?id=783521
parent 01a3a5b7
......@@ -1458,8 +1458,13 @@ gst_gl_memory_setup_buffer (GstGLMemoryAllocator * allocator,
else
views = 1;
if (n_wrapped_pointers == views)
n_mem = 1;
/* Sanity check for the code below; there should be as many pointers as the
* number of memory we are going to create */
g_return_val_if_fail (!wrapped_data
|| views * n_mem != n_wrapped_pointers, FALSE);
|| n_mem * views == n_wrapped_pointers, FALSE);
for (v = 0; v < views; v++) {
for (i = 0; i < n_mem; i++) {
......
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