Check return value of SDL_malloc()
(cherry picked from commit a4604cb0d6)
This commit is contained in:
1 parent
120bc77e91
commit
a688ecd6fa
1 file changed
+5
@@ -138,6 +138,11 @@ static SDL_ShapeTree *RecursivelyCalculateShapeTree(SDL_WindowShapeMode mode, SD
|
|||||||
SDL_ShapeTree *result = (SDL_ShapeTree *)SDL_malloc(sizeof(SDL_ShapeTree));
|
SDL_ShapeTree *result = (SDL_ShapeTree *)SDL_malloc(sizeof(SDL_ShapeTree));
|
||||||
SDL_Rect next = { 0, 0, 0, 0 };
|
SDL_Rect next = { 0, 0, 0, 0 };
|
||||||
|
|
||||||
|
if (result == NULL) {
|
||||||
|
SDL_OutOfMemory();
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
for (y = dimensions.y; y < dimensions.y + dimensions.h; y++) {
|
for (y = dimensions.y; y < dimensions.y + dimensions.h; y++) {
|
||||||
for (x = dimensions.x; x < dimensions.x + dimensions.w; x++) {
|
for (x = dimensions.x; x < dimensions.x + dimensions.w; x++) {
|
||||||
pixel_value = 0;
|
pixel_value = 0;
|
||||||
|
|||||||
Reference in new issue
Block a user