From a50c09ac266d47ebde97a1b5b787a02d8262343d Mon Sep 17 00:00:00 2001 From: Julien Isorce Date: Tue, 1 Aug 2017 10:21:51 +0100 Subject: [PATCH] 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 --- gst-libs/gst/gl/egl/gstglmemoryegl.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/gst-libs/gst/gl/egl/gstglmemoryegl.c b/gst-libs/gst/gl/egl/gstglmemoryegl.c index 378925f..32c4223 100644 --- a/gst-libs/gst/gl/egl/gstglmemoryegl.c +++ b/gst-libs/gst/gl/egl/gstglmemoryegl.c @@ -155,6 +155,11 @@ _gl_mem_egl_alloc (GstGLBaseMemoryAllocator * allocator, params->parent.alloc_params, params->v_info, params->plane, 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; } -- 2.7.4