This is an automated email from the git hooks/post-receive script.

git pushed a commit to branch master
in repository efl.

View the commit online.

commit 285a7a40ac9d2766042e2ac641e7b4cb0941ac54
Author: Cedric BAIL <[email protected]>
AuthorDate: Sun Nov 15 17:40:38 2026 -0600

    evas:gl_common: do not crash loading an image without a GL context
    
    evas_gl_common_image_new_from_rgbaimage() dereferences gc->shared
    without checking that there is a context. The GL engines look the
    context up through their outputs, and an output without a window
    has none: wayland_egl drops its window when its wl_surface goes
    away, so loading an image into such a canvas crashes. Failing the
    load is enough, the engine's image_load already returns NULL for
    other errors.
    
    This was found with an out of tree android engine, whose surface
    arrives asynchronously, and reproduced there. The wayland_egl path
    comes from reading the code and was not reproduced. No test covers
    it: it needs a GL engine without a window.
    
    Co-Authored-By: Claude Opus 5.5 <[email protected]>
---
 src/modules/evas/engines/gl_common/evas_gl_image.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/src/modules/evas/engines/gl_common/evas_gl_image.c b/src/modules/evas/engines/gl_common/evas_gl_image.c
index da9a67ff24..55cf2ea6fe 100644
--- a/src/modules/evas/engines/gl_common/evas_gl_image.c
+++ b/src/modules/evas/engines/gl_common/evas_gl_image.c
@@ -221,6 +221,15 @@ evas_gl_common_image_new_from_rgbaimage(Evas_Engine_GL_Context *gc, RGBA_Image *
      }
     */
 
+   /* An output without a window has no context: before its surface
+    * exists, or after the surface went away. */
+   if (!gc)
+     {
+        evas_cache_image_drop(&(im_im->cache_entry));
+        if (error) *error = EVAS_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED;
+        return NULL;
+     }
+
    if (error) *error = EVAS_LOAD_ERROR_NONE;
 
    // FIXME: keep unreffed shared images around

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.

Reply via email to