瀏覽代碼

SDL_ConvertSurface: clear sdl2-compat.surface2 on the converted surface

Fixes https://github.com/libsdl-org/sdl2-compat/issues/534
Ozkan Sezer 2 月之前
父節點
當前提交
02c4478f93
共有 1 個文件被更改,包括 3 次插入0 次删除
  1. 3 0
      src/video/SDL_surface.c

+ 3 - 0
src/video/SDL_surface.c

@@ -2153,6 +2153,9 @@ end:
         if (!SDL_CopyProperties(surface->props, SDL_GetSurfaceProperties(convert))) {
             goto error;
         }
+
+        // Make sure the new surface doesn't reference an old SDL2 surface.
+        SDL_ClearProperty(SDL_GetSurfaceProperties(convert), "sdl2-compat.surface2");
     }
 
     // We're ready to go!