[PATCH] [randr] don't try to compute crtc transform when no mode is set.

Keith Packard keithp at keithp.com
Fri Nov 14 14:12:57 PST 2008


Dereferencing the NULL mode pointer would cause a crash. As these transform
matrices won't be used while the CRTC is disabled, just leave their values
alone.
---
 randr/rrcrtc.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/randr/rrcrtc.c b/randr/rrcrtc.c
index c237f03..c431637 100644
--- a/randr/rrcrtc.c
+++ b/randr/rrcrtc.c
@@ -233,7 +233,7 @@ RRCrtcNotify (RRCrtcPtr	    crtc,
 	RRTransformCopy (&crtc->client_current_transform, transform);
 	RRCrtcChanged (crtc, TRUE);
     }
-    if (crtc->changed)
+    if (crtc->changed && mode)
     {
 	RRTransformCompute (x, y,
 			    mode->mode.width, mode->mode.height,
-- 
1.5.6.5




More information about the xorg mailing list