Commit f5eba2ccd63a3278fca726ae54e35878382cc2a3

Sylvain Becker 2021-01-05T12:00:54

Fixed invalid read in yuv_rgb_sse() (see bug #5430)

diff --git a/src/render/SDL_yuv_sw.c b/src/render/SDL_yuv_sw.c
index ae153c2..a4bd515 100644
--- a/src/render/SDL_yuv_sw.c
+++ b/src/render/SDL_yuv_sw.c
@@ -84,7 +84,7 @@ SDL_SW_CreateYUVTexture(Uint32 format, int w, int h)
                 SDL_assert(0 && "We should never get here (caught above)");
                 break;
         }
-        swdata->pixels = (Uint8 *) SDL_malloc(dst_size);
+        swdata->pixels = (Uint8 *) SDL_SIMDAlloc(dst_size);
         if (!swdata->pixels) {
             SDL_SW_DestroyYUVTexture(swdata);
             SDL_OutOfMemory();
@@ -439,7 +439,7 @@ void
 SDL_SW_DestroyYUVTexture(SDL_SW_YUVTexture * swdata)
 {
     if (swdata) {
-        SDL_free(swdata->pixels);
+        SDL_SIMDFree(swdata->pixels);
         SDL_FreeSurface(swdata->stretch);
         SDL_FreeSurface(swdata->display);
         SDL_free(swdata);