From 31d0a2d71c37f5beefa2f26aca7f790c8690c6c1 Mon Sep 17 00:00:00 2001 From: Sebastian Dransfeld Date: Sat, 7 Dec 2013 17:53:34 +0100 Subject: [PATCH] ecore_x: Only use att if call succeeds. XGetWindowAttributes isn't guaranteed to succeed. Fixes CID 1039692 --- src/lib/ecore_x/xlib/ecore_x_window.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/lib/ecore_x/xlib/ecore_x_window.c b/src/lib/ecore_x/xlib/ecore_x_window.c index 860e2bf9dc..ac0f34a06c 100644 --- a/src/lib/ecore_x/xlib/ecore_x_window.c +++ b/src/lib/ecore_x/xlib/ecore_x_window.c @@ -1591,14 +1591,16 @@ _ecore_x_window_argb_internal_new(Ecore_X_Window parent, else { /* ewww - round trip */ - XGetWindowAttributes(_ecore_x_disp, parent, &att); - if (_ecore_xlib_sync) ecore_x_sync(); - for (i = 0; i < ScreenCount(_ecore_x_disp); i++) + if (XGetWindowAttributes(_ecore_x_disp, parent, &att)) { - if (att.screen == ScreenOfDisplay(_ecore_x_disp, i)) + if (_ecore_xlib_sync) ecore_x_sync(); + for (i = 0; i < ScreenCount(_ecore_x_disp); i++) { - scr = i; - break; + if (att.screen == ScreenOfDisplay(_ecore_x_disp, i)) + { + scr = i; + break; + } } } }