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. 2
      test/egl_without_glx.c

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

Loading…
Cancel
Save