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

This commit is contained in:
Sylvain Becker 2021-01-05 12:00:54 +01:00
parent be4cfd51c3
commit f5eba2ccd6
1 changed files with 2 additions and 2 deletions

View File

@ -84,7 +84,7 @@ SDL_SW_CreateYUVTexture(Uint32 format, int w, int h)
SDL_assert(0 && "We should never get here (caught above)"); SDL_assert(0 && "We should never get here (caught above)");
break; break;
} }
swdata->pixels = (Uint8 *) SDL_malloc(dst_size); swdata->pixels = (Uint8 *) SDL_SIMDAlloc(dst_size);
if (!swdata->pixels) { if (!swdata->pixels) {
SDL_SW_DestroyYUVTexture(swdata); SDL_SW_DestroyYUVTexture(swdata);
SDL_OutOfMemory(); SDL_OutOfMemory();
@ -439,7 +439,7 @@ void
SDL_SW_DestroyYUVTexture(SDL_SW_YUVTexture * swdata) SDL_SW_DestroyYUVTexture(SDL_SW_YUVTexture * swdata)
{ {
if (swdata) { if (swdata) {
SDL_free(swdata->pixels); SDL_SIMDFree(swdata->pixels);
SDL_FreeSurface(swdata->stretch); SDL_FreeSurface(swdata->stretch);
SDL_FreeSurface(swdata->display); SDL_FreeSurface(swdata->display);
SDL_free(swdata); SDL_free(swdata);