From d17c386aee55bd223297adf78cf0fc1db43baf2d Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 17 Jan 2007 15:49:08 -0800 Subject: [PATCH] Fix some segfaults: crtc->rotatedPixmap not set and dangling damage pointer. --- src/i830_xf86Rotate.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/i830_xf86Rotate.c b/src/i830_xf86Rotate.c index 5482a6e1..14c0c5dd 100644 --- a/src/i830_xf86Rotate.c +++ b/src/i830_xf86Rotate.c @@ -247,6 +247,8 @@ xf86CrtcRotate (xf86CrtcPtr crtc, DisplayModePtr mode, Rotation rotation) if (xf86_config->rotationDamage) { /* Free damage structure */ + DamageUnregister (&(*pScreen->GetScreenPixmap)(pScreen)->drawable, + xf86_config->rotationDamage); DamageDestroy (xf86_config->rotationDamage); xf86_config->rotationDamage = NULL; /* Free block/wakeup handler */ @@ -274,6 +276,7 @@ xf86CrtcRotate (xf86CrtcPtr crtc, DisplayModePtr mode, Rotation rotation) shadow = crtc->funcs->shadow_create (crtc, width, height); if (!shadow) goto bail1; + crtc->rotatedPixmap = shadow; } if (!xf86_config->rotationDamage)