summaryrefslogtreecommitdiffstats
path: root/video/out/gl_x11.c
diff options
context:
space:
mode:
Diffstat (limited to 'video/out/gl_x11.c')
-rw-r--r--video/out/gl_x11.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/video/out/gl_x11.c b/video/out/gl_x11.c
index 88b586ce2d..434d0d8b3d 100644
--- a/video/out/gl_x11.c
+++ b/video/out/gl_x11.c
@@ -157,7 +157,7 @@ static GLXFBConfig select_fb_config(struct vo *vo, const int *attribs, int flags
return NULL;
// The list in fbc is sorted (so that the first element is the best).
- GLXFBConfig fbconfig = fbc[0];
+ GLXFBConfig fbconfig = fbcount > 0 ? fbc[0] : NULL;
if (flags & VOFLAG_ALPHA) {
for (int n = 0; n < fbcount; n++) {