Browse Source

video: fix surface leak when duplicating mjpeg

Green Sky 4 months ago
parent
commit
eb918af3dc
1 changed files with 1 additions and 0 deletions
  1. 1 0
      src/video/SDL_surface.c

+ 1 - 0
src/video/SDL_surface.c

@@ -1948,6 +1948,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);