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 - SDL_FreeSurface deallocates surface->map even if the surface is not yet freed
Summary: SDL_FreeSurface deallocates surface->map even if the surface is not yet freed
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: video (show other bugs)
Version: HG 2.1
Hardware: All All
: P2 normal
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-09-28 14:26 UTC by Evgeny Kapun
Modified: 2017-09-29 14:44 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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