Преглед изворни кода

Wayland: Fixed accessing not fully initialized window if no memory available.

The CreateWindow() implementation returned 0 on no more memory instead of -1.
Philipp Wiesemann пре 10 година
родитељ
комит
8a573844c9
1 измењених фајлова са 1 додато и 1 уклоњено
  1. 1 1
      src/video/wayland/SDL_waylandwindow.c

+ 1 - 1
src/video/wayland/SDL_waylandwindow.c

@@ -147,7 +147,7 @@ int Wayland_CreateWindow(_THIS, SDL_Window *window)
 
     data = calloc(1, sizeof *data);
     if (data == NULL)
-        return 0;
+        return SDL_OutOfMemory();
 
     c = _this->driverdata;
     window->driverdata = data;