diff options
author | Nicolas Dufresne <nicolas.dufresne@collabora.com> | 2017-06-07 18:00:08 +0200 |
---|---|---|
committer | Michael Olbrich <m.olbrich@pengutronix.de> | 2018-10-30 10:47:01 +0100 |
commit | 0ac646f7f4aa43399084dd63143cd47030885f5f (patch) | |
tree | 5a7509127e1d32d46fb6dd2c58fa5a37830d9894 | |
parent | f780c718e7750e6c4db65806c47184c218830548 (diff) | |
download | gst-plugins-base-0ac646f7f4aa43399084dd63143cd47030885f5f.tar.gz gst-plugins-base-0ac646f7f4aa43399084dd63143cd47030885f5f.tar.xz |
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
-rw-r--r-- | gst-libs/gst/gl/gstglmemory.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/gst-libs/gst/gl/gstglmemory.c b/gst-libs/gst/gl/gstglmemory.c index bf9782d46..5ef783b56 100644 --- a/gst-libs/gst/gl/gstglmemory.c +++ b/gst-libs/gst/gl/gstglmemory.c @@ -1433,8 +1433,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++) { |