xserver: Branch 'master' - 2 commits
Maarten Maathuis
madman2003 at kemper.freedesktop.org
Fri Aug 7 11:39:28 PDT 2009
exa/exa_migration_mixed.c | 3 ++-
exa/exa_mixed.c | 24 +++++++++++++-----------
2 files changed, 15 insertions(+), 12 deletions(-)
New commits:
commit 3943df7f76c1b4930fb7370d9d145cee96dd562b
Author: Maarten Maathuis <madman2003 at gmail.com>
Date: Fri Aug 7 20:36:03 2009 +0200
exa: one can never be too careful
diff --git a/exa/exa_migration_mixed.c b/exa/exa_migration_mixed.c
index 915bed9..91fadc2 100644
--- a/exa/exa_migration_mixed.c
+++ b/exa/exa_migration_mixed.c
@@ -99,7 +99,8 @@ exaCreateDriverPixmap_mixed(PixmapPtr pPixmap)
return;
pExaPixmap->offscreen = TRUE;
- pExaPixmap->sys_ptr = NULL;
+ pExaPixmap->sys_ptr = pPixmap->devPrivate.ptr = NULL;
+ pExaPixmap->sys_pitch = pPixmap->devKind = 0;
pExaPixmap->score = EXA_PIXMAP_SCORE_PINNED;
(*pScreen->ModifyPixmapHeader)(pPixmap, w, h, 0, 0,
commit 1548e8ae5d28ed0eb6057a1a19cfc84a78ef34dc
Author: Maarten Maathuis <madman2003 at gmail.com>
Date: Fri Aug 7 20:04:53 2009 +0200
exa: fix a potential loophole in "mixed"
- Always free sys_ptr before setting the pixmap to pinned.
diff --git a/exa/exa_mixed.c b/exa/exa_mixed.c
index 47fa6d4..0d2552d 100644
--- a/exa/exa_mixed.c
+++ b/exa/exa_mixed.c
@@ -145,20 +145,22 @@ exaModifyPixmapHeader_mixed(PixmapPtr pPixmap, int width, int height, int depth,
pExaPixmap = ExaGetPixmapPriv(pPixmap);
if (pExaPixmap) {
- if (pPixData) {
- if (!exaPixmapIsPinned(pPixmap)) {
- free(pExaPixmap->sys_ptr);
-
- /* We no longer need this. */
- if (pExaPixmap->pDamage) {
- DamageUnregister(&pPixmap->drawable, pExaPixmap->pDamage);
- DamageDestroy(pExaPixmap->pDamage);
- pExaPixmap->pDamage = NULL;
- }
+ if (!exaPixmapIsPinned(pPixmap)) {
+ free(pExaPixmap->sys_ptr);
+ pExaPixmap->sys_ptr = pPixmap->devPrivate.ptr = NULL;
+ pExaPixmap->sys_pitch = pPixmap->devKind = 0;
+
+ /* We no longer need this. */
+ if (pExaPixmap->pDamage) {
+ DamageUnregister(&pPixmap->drawable, pExaPixmap->pDamage);
+ DamageDestroy(pExaPixmap->pDamage);
+ pExaPixmap->pDamage = NULL;
}
- pExaPixmap->sys_ptr = pPixData;
}
+ if (pPixData)
+ pExaPixmap->sys_ptr = pPixData;
+
if (devKind > 0)
pExaPixmap->sys_pitch = devKind;
More information about the xorg-commit
mailing list