SDL: video: fix surface leak when duplicating mjpeg (79393)

From 79393095201dcab07b190529a81bcbf807b23104 Mon Sep 17 00:00:00 2001
From: Green Sky <[EMAIL REDACTED]>
Date: Fri, 28 Mar 2025 21:02:13 +0100
Subject: [PATCH] video: fix surface leak when duplicating mjpeg

(cherry picked from commit eb918af3dc9ca15071045cd2111b25fcbbe899a0)
---
 src/video/SDL_surface.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/video/SDL_surface.c b/src/video/SDL_surface.c
index 173bcbbb8ee4e..e6f13b8138078 100644
--- a/src/video/SDL_surface.c
+++ b/src/video/SDL_surface.c
@@ -1939,6 +1939,7 @@ SDL_Surface *SDL_ConvertSurfaceAndColorspace(SDL_Surface *surface, SDL_PixelForm
             if (!convert->pixels) {
                 goto error;
             }
+            convert->flags &= ~SDL_SURFACE_PREALLOCATED;
             convert->pitch = surface->pitch;
             SDL_memcpy(convert->pixels, surface->pixels, size);