summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXiang, Haihao <haihao.xiang@intel.com>2009-01-06 10:03:19 +0800
committerKeith Packard <keithp@keithp.com>2009-01-09 09:37:56 -0800
commit5f3188228eb988bd8f08b62c84f98a8ff66ee283 (patch)
tree6ded4b8021b4986c30b3e8b09b56a4744f3c899b
parentb2756a71a432f7cf7c870a48676c98625512558d (diff)
avoid a potential endless loop.
Previously it is possible that creating rotation data, then cleaning up and creating again so that pScreen->BlockHandler and xf86_config->BlockHandler all point to xf86RotateBlockHandler. See bug #19343.
-rw-r--r--hw/xfree86/modes/xf86Rotate.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/hw/xfree86/modes/xf86Rotate.c b/hw/xfree86/modes/xf86Rotate.c
index 8e03c6c11..21b7aff97 100644
--- a/hw/xfree86/modes/xf86Rotate.c
+++ b/hw/xfree86/modes/xf86Rotate.c
@@ -291,6 +291,8 @@ xf86RotateBlockHandler(int screenNum, pointer blockData,
/* Re-wrap if rotation is still happening */
xf86_config->BlockHandler = pScreen->BlockHandler;
pScreen->BlockHandler = xf86RotateBlockHandler;
+ } else {
+ xf86_config->BlockHandler = NULL;
}
}
@@ -477,9 +479,11 @@ xf86CrtcRotate (xf86CrtcPtr crtc)
goto bail2;
/* Wrap block handler */
+ if (!xf86_config->BlockHandler) {
xf86_config->BlockHandler = pScreen->BlockHandler;
pScreen->BlockHandler = xf86RotateBlockHandler;
}
+ }
#ifdef RANDR_12_INTERFACE
if (transform)
{