From 48a733a35a2de36664a42384d066c06f54cf2ad7 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Sun, 3 Mar 2013 15:32:23 +0000 Subject: [PATCH] sna: Only destroy the cached CLEAR picture if it exists Reported-by: Reinis Danne Signed-off-by: Chris Wilson --- src/sna/sna_composite.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/sna/sna_composite.c b/src/sna/sna_composite.c index 916d6da5..2b46f628 100644 --- a/src/sna/sna_composite.c +++ b/src/sna/sna_composite.c @@ -55,8 +55,12 @@ bool sna_composite_create(struct sna *sna) void sna_composite_close(struct sna *sna) { - FreePicture(sna->clear, 0); - sna->clear = NULL; + DBG(("%s\n", __FUNCTION__)); + + if (sna->clear) { + FreePicture(sna->clear, 0); + sna->clear = NULL; + } } static inline bool