[PATCH] exa: avoid calling non existent SourceValidate callback

Jerome Glisse jglisse at redhat.com
Mon Apr 26 07:01:48 PDT 2010


In unaccel path we were unconditionaly calling the SourceValidate
callback but in some case it could be NULL. Check if we have a
valid callback before calling it.

Signed-off-by: Jerome Glisse <jglisse at redhat.com>
Acked-by: Michel Dänzer <michel at daenzer.net>
---
 exa/exa_unaccel.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/exa/exa_unaccel.c b/exa/exa_unaccel.c
index b4ead7f..7754502 100644
--- a/exa/exa_unaccel.c
+++ b/exa/exa_unaccel.c
@@ -464,9 +464,11 @@ ExaSrcValidate(DrawablePtr pDrawable,
     REGION_UNION(pScreen, dst, dst, &reg);
     REGION_UNINIT(pScreen, &reg);
 
-    swap(pExaScr, pScreen, SourceValidate);
-    pScreen->SourceValidate(pDrawable, x, y, width, height);
-    swap(pExaScr, pScreen, SourceValidate);
+    if (pExaScr->SourceValidate) {
+        swap(pExaScr, pScreen, SourceValidate);
+        pScreen->SourceValidate(pDrawable, x, y, width, height);
+        swap(pExaScr, pScreen, SourceValidate);
+    }
 }
 
 static Bool
-- 
1.7.0.1



More information about the xorg-devel mailing list