summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-01-21 23:34:02 +0100
committerwm4 <wm4@nowhere>2014-01-21 23:34:02 +0100
commit302e8ff464663522234cfe5b182b9d84193b1981 (patch)
treed2bed57f03cb7da9eeb022a9a80cf4e38cf32c03
parent369e88c99b876fb1d617ad96a12c57f9c81b8ce3 (diff)
downloadmpv-302e8ff464663522234cfe5b182b9d84193b1981.tar.bz2
mpv-302e8ff464663522234cfe5b182b9d84193b1981.tar.xz
vo_opengl: don't assume there'a always 1 fbconfig on success
Seems to be a reasonable assumption, but it's probably not guaranteed.
-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++) {