glcontext: Don't call get_instance_private (NULL)

ubsan does not like this.

See a9175e0c03 for a detailed explanation.
This commit is contained in:
Matthias Clasen 2024-03-14 23:19:51 -04:00
parent 60ddf7c421
commit a9dfec8478

View File

@ -290,7 +290,7 @@ gdk_gl_context_create_egl_context (GdkGLContext *context,
GdkDisplay *display = gdk_gl_context_get_display (context);
EGLDisplay egl_display = gdk_display_get_egl_display (display);
GdkGLContext *share = gdk_display_get_gl_context (display);
GdkGLContextPrivate *share_priv = gdk_gl_context_get_instance_private (share);
GdkGLContextPrivate *share_priv = share ? gdk_gl_context_get_instance_private (share) : NULL;
EGLConfig egl_config;
EGLContext ctx;
EGLint context_attribs[N_EGL_ATTRS], i = 0, flags = 0;