Check for NULL Display.

This commit is contained in:
Brandon Wright 2018-07-12 10:15:07 -05:00
parent 798aa86a45
commit 2de55719de
2 changed files with 6 additions and 0 deletions

View File

@ -887,6 +887,9 @@ S9xOpenGLDisplayDriver::query_availability (void)
int errorBase, eventBase; int errorBase, eventBase;
Display *display = GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()); Display *display = GDK_DISPLAY_XDISPLAY (gdk_display_get_default ());
if (!display)
return 0;
if (glXQueryExtension (display, &errorBase, &eventBase) == False) if (glXQueryExtension (display, &errorBase, &eventBase) == False)
{ {
if (gui_config->hw_accel == HWA_OPENGL) if (gui_config->hw_accel == HWA_OPENGL)

View File

@ -615,6 +615,9 @@ S9xXVDisplayDriver::query_availability (void)
p_error_base; p_error_base;
Display *display = GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()); Display *display = GDK_DISPLAY_XDISPLAY (gdk_display_get_default ());
if (!display)
return 0;
/* Test if XV and SHM are feasible */ /* Test if XV and SHM are feasible */
if (!XShmQueryExtension (display)) if (!XShmQueryExtension (display))
{ {