[cogl/cogl-1.14] xlib: Don't crash just because the display doesn't expose RANDR



commit e26464f4a7ce3776727f78afb2f7b4f9d6bec4b9
Author: Adam Jackson <ajax redhat com>
Date:   Wed May 1 19:26:06 2013 -0400

    xlib: Don't crash just because the display doesn't expose RANDR
    
    If this happens, XRRGetScreenResources will return NULL, so just treat
    that like nothing happened.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=699431
    
    Signed-off-by: Adam Jackson <ajax redhat com>
    Reviewed-by: Robert Bragg <robert linux intel com>
    
    (cherry picked from commit 57a79912ac70080a2f9cbe65181a25b00bf1192a)

 cogl/cogl-xlib-renderer.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/cogl/cogl-xlib-renderer.c b/cogl/cogl-xlib-renderer.c
index 18c0fe6..eb1f51a 100644
--- a/cogl/cogl-xlib-renderer.c
+++ b/cogl/cogl-xlib-renderer.c
@@ -238,7 +238,7 @@ update_outputs (CoglRenderer *renderer,
 
   _cogl_xlib_renderer_trap_errors (renderer, &state);
 
-  for (i = 0; i < resources->ncrtc && !error; i++)
+  for (i = 0; resources && i < resources->ncrtc && !error; i++)
     {
       XRRCrtcInfo *crtc_info = NULL;
       XRROutputInfo *output_info = NULL;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]