test: Avoid egl_without_glx crash on NVIDIA

The NVIDIA driver calls dlopen with NULL as filename; strcmp is not
NULL-safe.
macos/v1.5.9
Jan Alexander Steffens (heftig) 7 years ago committed by Adam Jackson
parent c28759fb3a
commit 6c6fcd3b12
  1. 14
      test/egl_without_glx.c

@ -54,15 +54,17 @@ dlopen(const char *filename, int flag)
{
void * (*dlopen_unwrapped)(const char *filename, int flag);
if (!strcmp(filename, "libGL.so.1"))
return NULL;
if (filename) {
if (!strcmp(filename, "libGL.so.1"))
return NULL;
#if GLES_VERSION == 2
if (!strcmp(filename, "libGLESv1_CM.so.1"))
return NULL;
if (!strcmp(filename, "libGLESv1_CM.so.1"))
return NULL;
#else
if (!strcmp(filename, "libGLESv2.so.2"))
return NULL;
if (!strcmp(filename, "libGLESv2.so.2"))
return NULL;
#endif
}
dlopen_unwrapped = dlsym(RTLD_NEXT, "dlopen");
assert(dlopen_unwrapped);

Loading…
Cancel
Save