Skip to content

Commit 0af491c

Browse files
committed
Surface2to3: Need to set surface w and h if changed, not assert.
sdl12-compat creates the video surface with 0x0 dimensions until it gets further through initialization, and sdl2-compat and SDL3 need to catch up with their internal state later.
1 parent c8cedca commit 0af491c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/sdl2_compat.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -2753,8 +2753,8 @@ static SDL_Surface *Surface2to3(SDL2_Surface *surface)
27532753
* The application might have changed memory allocation, e.g.:
27542754
* https://github.com/libsdl-org/SDL_ttf/blob/7e4a456bf463b887b94c191030dd742d7654d6ff/SDL_ttf.c#L1476-L1478
27552755
*/
2756-
SDL_assert(surface->w == surface3->w);
2757-
SDL_assert(surface->h == surface3->h);
2756+
surface3->w = surface->w;
2757+
surface3->h = surface->h;
27582758
surface3->flags &= ~(surface->flags & SHARED_SURFACE_FLAGS);
27592759
surface3->flags |= (surface->flags & SHARED_SURFACE_FLAGS);
27602760
surface3->pixels = surface->pixels;

0 commit comments

Comments
 (0)