Commit 8a573844c9695c66fac27a853c4b198e12c92481

Philipp Wiesemann 2015-04-09T21:11:43

Wayland: Fixed accessing not fully initialized window if no memory available. The CreateWindow() implementation returned 0 on no more memory instead of -1.

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/src/video/wayland/SDL_waylandwindow.c b/src/video/wayland/SDL_waylandwindow.c
index b66508f..d6d83aa 100644
--- a/src/video/wayland/SDL_waylandwindow.c
+++ b/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;