englebass pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=31d0a2d71c37f5beefa2f26aca7f790c8690c6c1

commit 31d0a2d71c37f5beefa2f26aca7f790c8690c6c1
Author: Sebastian Dransfeld <s...@tango.flipp.net>
Date:   Sat Dec 7 17:53:34 2013 +0100

    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 860e2bf..ac0f34a 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;
+                    }
                }
           }
      }

-- 


Reply via email to