From 8a4758a358e56b1db481607ff3f7e9375238e5d8 Mon Sep 17 00:00:00 2001 From: Zhigang Gong Date: Wed, 4 Jan 2012 13:11:52 +0800 Subject: [PATCH] Need to check pixmap priv before touch its field. As now the pixmap may be allocated by DDX and doesn't have a valid pixmap private field. We must check pixmap private pointer before touch its field value. If a pixmap doesn't have a non-NULL private pointer, it doesn't have a valid FBO. Signed-off-by: Zhigang Gong --- glamor/glamor_utils.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/glamor/glamor_utils.h b/glamor/glamor_utils.h index 4d47f57ae..9eea70e11 100644 --- a/glamor/glamor_utils.h +++ b/glamor/glamor_utils.h @@ -176,7 +176,7 @@ glamor_transform_boxes(BoxPtr boxes, int nbox, int dx, int dy) #define GLAMOR_PIXMAP_PRIV_IS_PICTURE(pixmap_priv) (pixmap_priv->is_picture == 1) -#define GLAMOR_PIXMAP_PRIV_HAS_FBO(pixmap_priv) (pixmap_priv->gl_fbo == 1) +#define GLAMOR_PIXMAP_PRIV_HAS_FBO(pixmap_priv) (pixmap_priv && pixmap_priv->gl_fbo == 1) #define GLAMOR_PIXMAP_PRIV_NEED_VALIDATE(pixmap_priv) \ (GLAMOR_PIXMAP_PRIV_HAS_FBO(pixmap_priv) \