mirror of https://github.com/encounter/SDL.git
Fixed bug 3852 - SDL_FreeSurface deallocates surface->map even if the surface is not yet freed
Evgeny Kapun Commit 490bb5b49f11 [1], which was a fix for bug #3790, introduced a new bug: now, calling SDL_FreeSurface(surface) deallocates surface->map even if there are other references to the surface. This is bad, because some functions (such as SDL_ConvertSurface) assume that surface->map is not NULL.
This commit is contained in:
parent
bd5c984ac0
commit
aad58c622c
|
@ -1198,10 +1198,8 @@ SDL_FreeSurface(SDL_Surface * surface)
|
||||||
if (surface->flags & SDL_DONTFREE) {
|
if (surface->flags & SDL_DONTFREE) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (surface->map != NULL) {
|
SDL_InvalidateMap(surface->map);
|
||||||
SDL_FreeBlitMap(surface->map);
|
|
||||||
surface->map = NULL;
|
|
||||||
}
|
|
||||||
if (--surface->refcount > 0) {
|
if (--surface->refcount > 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue