We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 3852

Summary: SDL_FreeSurface deallocates surface->map even if the surface is not yet freed
Product: SDL Reporter: Evgeny Kapun <abacabadabacaba>
Component: videoAssignee: Sam Lantinga <slouken>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2 CC: sezeroz
Version: HG 2.1   
Hardware: All   
OS: All   

Description Evgeny Kapun 2017-09-28 14:26:25 UTC
Commit 52dcef74bdc5 [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.

[1] https://hg.libsdl.org/SDL/rev/52dcef74bdc5
Comment 1 Sam Lantinga 2017-09-29 14:44:52 UTC
Argh, thank you. This is fixed:
https://hg.libsdl.org/SDL/rev/a09c3f87a12f