From 302e8ff464663522234cfe5b182b9d84193b1981 Mon Sep 17 00:00:00 2001 From: wm4 Date: Tue, 21 Jan 2014 23:34:02 +0100 Subject: vo_opengl: don't assume there'a always 1 fbconfig on success Seems to be a reasonable assumption, but it's probably not guaranteed. --- video/out/gl_x11.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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++) { -- cgit v1.2.3