Commit 9a874a71 authored by Egbert Eich's avatar Egbert Eich

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.
parent a4d62bbf
......@@ -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;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment