From a39cef41b85ca6f38f3e9c95fbd18de990f73b7f Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Fri, 19 Mar 2010 11:39:23 +0000 Subject: [PATCH] glx: Do not access stage_clip without checking it The stage_clip parameter for add_redraw_clip() can be NULL, so we need to check before accessing its members. --- clutter/glx/clutter-stage-glx.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/clutter/glx/clutter-stage-glx.c b/clutter/glx/clutter-stage-glx.c index 954d347e4..d74708577 100644 --- a/clutter/glx/clutter-stage-glx.c +++ b/clutter/glx/clutter-stage-glx.c @@ -377,14 +377,15 @@ clutter_stage_glx_add_redraw_clip (ClutterStageWindow *stage_window, if (clutter_stage_glx_ignoring_redraw_clips (stage_window)) return; - /* Do nothing on an empty clip, to avoid confusing with the flag degenerate clip */ - if (stage_clip->width == 0) + /* Do nothing on an empty clip, to avoid confusing with the flag degenerate + * clip */ + if (stage_clip != NULL && stage_clip->width == 0) return; /* A NULL stage clip means a full stage redraw has been queued and * we keep track of this by setting a degenerate * stage_glx->bounding_redraw_clip */ - if (!stage_clip) + if (stage_clip == NULL) { stage_glx->bounding_redraw_clip.width = 0; return;