X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=utils%2Fvisual.c;h=89b4f33e69f3d7af84fc2a5931ae594c1916a47e;hb=aa75c7476aeaa84cf3abc192b376a8b03c325213;hp=b3f06061a01b41b58261b2564b52a3735fe3eca6;hpb=8afc01a67be4fbf3f1cc0fce9adf01b5289a21c6;p=xscreensaver diff --git a/utils/visual.c b/utils/visual.c index b3f06061..89b4f33e 100644 --- a/utils/visual.c +++ b/utils/visual.c @@ -19,11 +19,14 @@ #include "visual.h" #include +#ifndef HAVE_ANDROID #include +#else +#include "../android/android-visual.h" +#endif extern char *progname; - #ifndef isupper # define isupper(c) ((c) >= 'A' && (c) <= 'Z') #endif @@ -295,7 +298,7 @@ pick_best_gl_visual (Screen *screen) int ndepths = 0; int *depths = XListDepths (dpy, screen_number (screen), &ndepths); - int screen_depth = depths[ndepths]; + int screen_depth = (depths && ndepths) ? depths[ndepths - 1] : 0; XFree (depths); vi_in.class = TrueColor;