xserver: Branch 'master'

Egbert Eich eich at kemper.freedesktop.org
Tue Nov 4 12:33:40 PST 2008


 hw/xfree86/modes/xf86Crtc.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

New commits:
commit 9a874a71a791c6110fd57b8a5c083f777a446d0f
Author: Egbert Eich <eich at freedesktop.org>
Date:   Tue Nov 4 21:31:27 2008 +0100

    DDX/RandR: When positioning outputs assume width/height = 0 if no modes exist.
    
    When a user specifies the position of an output for which no modes exist
    (for whatever reason) assume that the width and height of this output
    is 0. The result will be the same as if this output isn't taken into
    consideration at all and thus should be sane. It will prevent a segfault
    when trying to determine the width and height of a non-existent mode.

diff --git a/hw/xfree86/modes/xf86Crtc.c b/hw/xfree86/modes/xf86Crtc.c
index df47598..f072109 100644
--- a/hw/xfree86/modes/xf86Crtc.c
+++ b/hw/xfree86/modes/xf86Crtc.c
@@ -1185,10 +1185,12 @@ xf86InitialOutputPositions (ScrnInfoPtr scrn, DisplayModePtr *modes)
 		    output->initial_x += xf86ModeWidth (modes[or], relative->initial_rotation);
 		    break;
 		case OPTION_ABOVE:
-		    output->initial_y -= xf86ModeHeight (modes[o], output->initial_rotation);
+		    if (modes[o])
+			output->initial_y -= xf86ModeHeight (modes[o], output->initial_rotation);
 		    break;
 		case OPTION_LEFT_OF:
-		    output->initial_x -= xf86ModeWidth (modes[o], output->initial_rotation);
+		    if (modes[o])
+			output->initial_x -= xf86ModeWidth (modes[o], output->initial_rotation);
 		    break;
 		default:
 		    break;


More information about the xorg-commit mailing list