mirror of
https://github.com/Ryujinx/SDL.git
synced 2024-12-23 15:15:39 +00:00
X11: use SDL_malloc
This commit is contained in:
parent
19bf36db15
commit
9fcc630fb3
|
@ -35,7 +35,7 @@ X11_CreateShaper(SDL_Window* window) {
|
|||
|
||||
#if SDL_VIDEO_DRIVER_X11_XSHAPE
|
||||
if (SDL_X11_HAVE_XSHAPE) { /* Make sure X server supports it. */
|
||||
result = malloc(sizeof(SDL_WindowShaper));
|
||||
result = SDL_malloc(sizeof(SDL_WindowShaper));
|
||||
result->window = window;
|
||||
result->mode.mode = ShapeModeDefault;
|
||||
result->mode.parameters.binarizationCutoff = 1;
|
||||
|
@ -65,8 +65,8 @@ X11_ResizeWindowShape(SDL_Window* window) {
|
|||
if(data->bitmapsize != bitmapsize || data->bitmap == NULL) {
|
||||
data->bitmapsize = bitmapsize;
|
||||
if(data->bitmap != NULL)
|
||||
free(data->bitmap);
|
||||
data->bitmap = malloc(data->bitmapsize);
|
||||
SDL_free(data->bitmap);
|
||||
data->bitmap = SDL_malloc(data->bitmapsize);
|
||||
if(data->bitmap == NULL) {
|
||||
return SDL_SetError("Could not allocate memory for shaped-window bitmap.");
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue