Sophie

Sophie

distrib > * > 2008.0 > x86_64 > by-pkgid > e265b08b6bebf8514a189c80db57a2d3 > files > 13

x11-server-1.3.0.0-25.1mdv2008.0.src.rpm

From c5502678d7916429b5b374e8615e6595e6813a50 Mon Sep 17 00:00:00 2001
From: Aaron Plattner <aplattner@nvidia.com>
Date: Tue, 31 Jul 2007 16:33:37 -0700
Subject: [PATCH] Fix a crash when rotating the screen.

Remember output->crtc before setting a NULL mode because RRCrtcNotify now sets
output->crtc to NULL.  Use the saved crtc to set the new mode.
---
 randr/rrscreen.c |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/randr/rrscreen.c b/randr/rrscreen.c
index f2981b0..bd2c1d4 100644
--- a/randr/rrscreen.c
+++ b/randr/rrscreen.c
@@ -738,6 +738,7 @@ ProcRRSetScreenConfig (ClientPtr client)
     int			    rate;
     Bool		    has_rate;
     RROutputPtr		    output;
+    RRCrtcPtr		    crtc;
     RRModePtr		    mode;
     RR10DataPtr		    pData = NULL;
     RRScreenSizePtr    	    pSize;
@@ -782,7 +783,9 @@ ProcRRSetScreenConfig (ClientPtr client)
 	rep.status = RRSetConfigFailed;
 	goto sendReply;
     }
-    
+
+    crtc = output->crtc;
+
     /*
      * if the client's config timestamp is not the same as the last config
      * timestamp, then the config information isn't up-to-date and
@@ -830,7 +833,7 @@ ProcRRSetScreenConfig (ClientPtr client)
 	return BadValue;
     }
 
-    if ((~output->crtc->rotations) & rotation)
+    if ((~crtc->rotations) & rotation)
     {
 	/*
 	 * requested rotation or reflection not supported by screen
@@ -913,7 +916,7 @@ ProcRRSetScreenConfig (ClientPtr client)
 	}
     }
 
-    if (!RRCrtcSet (output->crtc, mode, 0, 0, stuff->rotation, 1, &output))
+    if (!RRCrtcSet (crtc, mode, 0, 0, stuff->rotation, 1, &output))
 	rep.status = RRSetConfigFailed;
     else
 	rep.status = RRSetConfigSuccess;
-- 
1.5.2.4