SDL 1.2 ignores SDL_FreeSurface() attempts on the screen surface.
authorRyan C. Gordon <icculus@icculus.org>
Fri, 22 Mar 2019 09:43:16 -0400
changeset 114f4f3bf9e36e1
parent 113 ed19faa58a82
child 115 ea2ce36617d5
SDL 1.2 ignores SDL_FreeSurface() attempts on the screen surface.

Fixes Bugzilla #4559.
src/SDL12_compat.c
     1.1 --- a/src/SDL12_compat.c	Sun Mar 10 00:18:10 2019 -0500
     1.2 +++ b/src/SDL12_compat.c	Fri Mar 22 09:43:16 2019 -0400
     1.3 @@ -2319,7 +2319,7 @@
     1.4  DECLSPEC void SDLCALL
     1.5  SDL_FreeSurface(SDL12_Surface *surface12)
     1.6  {
     1.7 -    if (surface12) {
     1.8 +    if (surface12 && (surface12 != VideoSurface12)) {
     1.9          SDL20_FreeSurface(surface12->surface20);
    1.10          if (surface12->format) {
    1.11              SDL20_free(surface12->format->palette);