src/video/SDL_surface.c
changeset 12587 b2d4dcb4ba33
parent 12584 233b2a61cad1
child 12589 85bc5436a005
     1.1 --- a/src/video/SDL_surface.c	Wed Jan 30 22:50:20 2019 +0100
     1.2 +++ b/src/video/SDL_surface.c	Thu Jan 31 11:45:31 2019 +0100
     1.3 @@ -26,6 +26,7 @@
     1.4  #include "SDL_RLEaccel_c.h"
     1.5  #include "SDL_pixels_c.h"
     1.6  #include "SDL_yuv_c.h"
     1.7 +#include "../../cpuinfo/SDL_simd.h"
     1.8  
     1.9  
    1.10  /* Check to make sure we can safely check multiplication of surface w and pitch and it won't overflow size_t */
    1.11 @@ -289,7 +290,7 @@
    1.12          return SDL_FALSE;
    1.13      }
    1.14  
    1.15 -	return SDL_TRUE;
    1.16 +    return SDL_TRUE;
    1.17  }
    1.18  
    1.19  int
    1.20 @@ -1258,7 +1259,13 @@
    1.21          SDL_FreeFormat(surface->format);
    1.22          surface->format = NULL;
    1.23      }
    1.24 -    if (!(surface->flags & SDL_PREALLOC)) {
    1.25 +    if (surface->flags & SDL_PREALLOC) {
    1.26 +        /* Don't free */
    1.27 +    } else if (surface->flags & SDL_MEMALIGNED) {
    1.28 +        /* Free aligned */
    1.29 +        SDL_SIMDFree(surface->pixels);
    1.30 +    } else {
    1.31 +        /* Normal */
    1.32          SDL_free(surface->pixels);
    1.33      }
    1.34      if (surface->map) {