Check return value of SDL_malloc()
This commit is contained in:
committed by
Ryan C. Gordon
parent
f431037f62
commit
a4604cb0d6
@@ -131,6 +131,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