SDL: Fix memory leak in SDL_SW_CreateYUVTexture

From 721ece7ba041e7977bf906e5d21c38c44996a38c Mon Sep 17 00:00:00 2001
From: Mathieu Eyraud <[EMAIL REDACTED]>
Date: Mon, 2 Jan 2023 10:22:44 +0100
Subject: [PATCH] Fix memory leak in SDL_SW_CreateYUVTexture

---
 src/render/SDL_yuv_sw.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/render/SDL_yuv_sw.c b/src/render/SDL_yuv_sw.c
index 7cb19ced6209..c407f8627a25 100644
--- a/src/render/SDL_yuv_sw.c
+++ b/src/render/SDL_yuv_sw.c
@@ -59,6 +59,7 @@ SDL_SW_CreateYUVTexture(Uint32 format, int w, int h)
     {
         size_t dst_size;
         if (SDL_CalculateYUVSize(format, w, h, &dst_size, NULL) < 0) {
+            SDL_SW_DestroyYUVTexture(swdata);
             SDL_OutOfMemory();
             return NULL;
         }