[Cogl] [PATCH] egl-x11: Fix a crash when the app has non-Cogl windows

Neil Roberts neil at linux.intel.com
Wed Jun 19 05:37:25 PDT 2013


The handler for ConfigureNotify events in the EGL X11 winsys was
incorrectly trying dereference the onscreen pointer even if it didn't
find an onscreen for the X window that has resized. This meant that if
the application has other windows that weren't created by Cogl then it
would crash when handling events for them.
---
 cogl/winsys/cogl-winsys-egl-x11.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/cogl/winsys/cogl-winsys-egl-x11.c b/cogl/winsys/cogl-winsys-egl-x11.c
index 24e45bf..b047db4 100644
--- a/cogl/winsys/cogl-winsys-egl-x11.c
+++ b/cogl/winsys/cogl-winsys-egl-x11.c
@@ -136,8 +136,8 @@ notify_resize (CoglContext *context,
   CoglRenderer *renderer = context->display->renderer;
   CoglRendererEGL *egl_renderer = renderer->winsys;
   CoglOnscreen *onscreen = find_onscreen_for_xid (context, drawable);
-  CoglOnscreenEGL *egl_onscreen = onscreen->winsys;
   CoglFramebuffer *framebuffer = COGL_FRAMEBUFFER (onscreen);
+  CoglOnscreenEGL *egl_onscreen;
 
   if (!onscreen)
     return;
-- 
1.7.11.3.g3c3efa5



More information about the Cogl mailing list