gl: return NULL mem if eglCreateImage failed

Found on rpi when gpu_mem is too low so there is not enough memory to
create the eglimage. But still gst_buffer_pool_acquire_buffer succeeded.
And it leads to a CRITICAL assert:
  gst_egl_image_get_image: assertion 'GST_IS_EGL_IMAGE (image)' failed

https://bugzilla.gnome.org/show_bug.cgi?id=785518
This commit is contained in:
Julien Isorce 2017-08-01 10:21:51 +01:00
parent db07f4507d
commit b89c94b37e

View file

@ -155,6 +155,11 @@ _gl_mem_egl_alloc (GstGLBaseMemoryAllocator * allocator,
params->parent.alloc_params, params->v_info, params->plane, params->parent.alloc_params, params->v_info, params->plane,
params->valign, params->parent.user_data, params->parent.notify); params->valign, params->parent.user_data, params->parent.notify);
if (!mem->image) {
gst_allocator_free (GST_ALLOCATOR_CAST (allocator), GST_MEMORY_CAST (mem));
return NULL;
}
return mem; return mem;
} }