Don't try to query outputs that are not hooked up to a crtc
authorSam Lantinga <slouken@libsdl.org>
Wed, 03 Oct 2012 19:24:11 -0700
changeset 6550 191f00a080ba
parent 6549 db16b819e1d1
child 6551 b0679a0d5751
Don't try to query outputs that are not hooked up to a crtc
src/video/x11/SDL_x11modes.c
--- a/src/video/x11/SDL_x11modes.c	Wed Oct 03 19:02:46 2012 -0700
+++ b/src/video/x11/SDL_x11modes.c	Wed Oct 03 19:24:11 2012 -0700
@@ -511,7 +511,8 @@
 
             for (output = 0; output < res->noutput; output++) {
                 output_info = XRRGetOutputInfo(data->display, res, res->outputs[output]);
-                if (!output_info || output_info->connection == RR_Disconnected) {
+                if (!output_info || !output_info->crtc ||
+                    output_info->connection == RR_Disconnected) {
                     XRRFreeOutputInfo(output_info);
                     continue;
                 }