summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorÉric Piel <E.A.B.Piel@tudelft.nl>2010-06-11 09:16:32 -0700
committerJulien Cristau <jcristau@debian.org>2010-06-17 15:21:09 +0100
commit5154dede3d53151f4bed43b0e1626abf64b91fc5 (patch)
tree0274a984758cfac79c72e78a1fcf417e82d5739e
parentf44ebbd3d52fa0dfdc51f6635721592b70affb6e (diff)
exa: fix ExaCheckCopyNtoN for exa_classic when source = destserver-1.7-nominations
In case you want to copy a region with source = dest, you have the same pixmap as source and dest. At the end of exaPixmapIsOffscreen_classic() the devPrivate.ptr is reset to NULL (look at the sources). Now this is what happens in ExaCheckCopyNtoN: exaPrepareAccess( pDst ); Calls IsOffscreen() sets devPrivate.ptr to NULL sets up devPrivate.ptr to real pointer Everything OK exaPrepareAccess( pSrc ); Calls IsOffscreen() sets devPrivate.ptr to NULL BAILS OUT CAUSE OF NESTED OPERATION SINCE DST EQUALS SRC We end up with devPrivate.ptr as NULL, and that is clearly wrong. In particular this fixes a segfault when using the psb driver (bug 28077) Signed-off-by: Éric Piel <eric.piel@tremplin-utc.net> Reviewed-by: Michel Dänzer <michel@daenzer.net> Signed-off-by: Keith Packard <keithp@keithp.com> (cherry picked from commit 7e8f1001217326cc451974bacf25275420c4bb4e)
-rw-r--r--exa/exa_classic.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/exa/exa_classic.c b/exa/exa_classic.c
index 12f398709..28cc42140 100644
--- a/exa/exa_classic.c
+++ b/exa/exa_classic.c
@@ -256,9 +256,10 @@ exaPixmapIsOffscreen_classic(PixmapPtr pPixmap)
Bool ret;
if (pExaScr->info->PixmapIsOffscreen) {
+ void* old_ptr = pPixmap->devPrivate.ptr;
pPixmap->devPrivate.ptr = ExaGetPixmapAddress(pPixmap);
ret = pExaScr->info->PixmapIsOffscreen(pPixmap);
- pPixmap->devPrivate.ptr = NULL;
+ pPixmap->devPrivate.ptr = old_ptr;
} else
ret = (pExaPixmap->offscreen && pExaPixmap->fb_ptr);