mirror of
https://github.com/Ryujinx/SDL.git
synced 2024-12-24 16:45:29 +00:00
Don't use SDL_SIMDFree() if the pixels haven't been allocated with SDL_SIMDAlloc()
This commit is contained in:
parent
2f924020e8
commit
6da99d4a6c
|
@ -1218,9 +1218,13 @@ RLEAlphaSurface(SDL_Surface * surface)
|
||||||
|
|
||||||
/* Now that we have it encoded, release the original pixels */
|
/* Now that we have it encoded, release the original pixels */
|
||||||
if (!(surface->flags & SDL_PREALLOC)) {
|
if (!(surface->flags & SDL_PREALLOC)) {
|
||||||
|
if (surface->flags & SDL_SIMD_ALIGNED) {
|
||||||
SDL_SIMDFree(surface->pixels);
|
SDL_SIMDFree(surface->pixels);
|
||||||
surface->pixels = NULL;
|
|
||||||
surface->flags &= ~SDL_SIMD_ALIGNED;
|
surface->flags &= ~SDL_SIMD_ALIGNED;
|
||||||
|
} else {
|
||||||
|
SDL_free(surface->pixels);
|
||||||
|
}
|
||||||
|
surface->pixels = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* reallocate the buffer to release unused memory */
|
/* reallocate the buffer to release unused memory */
|
||||||
|
@ -1382,9 +1386,13 @@ RLEColorkeySurface(SDL_Surface * surface)
|
||||||
|
|
||||||
/* Now that we have it encoded, release the original pixels */
|
/* Now that we have it encoded, release the original pixels */
|
||||||
if (!(surface->flags & SDL_PREALLOC)) {
|
if (!(surface->flags & SDL_PREALLOC)) {
|
||||||
|
if (surface->flags & SDL_SIMD_ALIGNED) {
|
||||||
SDL_SIMDFree(surface->pixels);
|
SDL_SIMDFree(surface->pixels);
|
||||||
surface->pixels = NULL;
|
|
||||||
surface->flags &= ~SDL_SIMD_ALIGNED;
|
surface->flags &= ~SDL_SIMD_ALIGNED;
|
||||||
|
} else {
|
||||||
|
SDL_free(surface->pixels);
|
||||||
|
}
|
||||||
|
surface->pixels = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* reallocate the buffer to release unused memory */
|
/* reallocate the buffer to release unused memory */
|
||||||
|
|
Loading…
Reference in a new issue