Explorar el Código

Null check SDL_DBusContext pointer

Omar Rashwan hace 2 años
padre
commit
67bbf20add
Se han modificado 1 ficheros con 3 adiciones y 0 borrados
  1. 3 0
      src/video/wayland/SDL_waylandvideo.c

+ 3 - 0
src/video/wayland/SDL_waylandvideo.c

@@ -101,6 +101,9 @@ static SDL_bool Wayland_GetGNOMEPrimaryDisplayCoordinates(int *x, int *y)
 {
 #ifdef SDL_USE_LIBDBUS
     SDL_DBusContext *dbus = SDL_DBus_GetContext();
+    if (dbus == NULL) {
+        return SDL_FALSE;
+    }
     DBusMessage *reply = NULL;
     DBusMessageIter iter[3];
     DBusMessage *msg = dbus->message_new_method_call(DISPLAY_INFO_NODE,