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 755

Summary: SDL_DisplayFormatAlpha() crashes
Product: SDL Reporter: Sjors Gielen <dazjorz>
Component: videoAssignee: Ryan C. Gordon <icculus>
Status: RESOLVED INVALID QA Contact: Sam Lantinga <slouken>
Severity: major    
Priority: P2    
Version: 1.2.13   
Hardware: x86   
OS: Linux   
Attachments: Testcase
Sample file with which this bug occurs

Description Sjors Gielen 2009-06-15 15:36:17 UTC
I am using SDL_DisplayFormatAlpha() on a surface just previously loaded from a BMP file. I will attach the test case and the BMP image I am using. It is 8 bpp. What I was trying to do in my main application, was set the alpha color key to 0, because that's the color of the "background" which I want transparent. Then I called SDL_DisplayFormatAlpha to get a nice 32-bpp image with alpha value which I could use to blit over my screen.
However, I noticed SDL_DisplayFormatAlpha kept crashing so I wrote a test case. The segfault has been confirmed by two other people.
Comment 1 Sjors Gielen 2009-06-15 15:38:49 UTC
Created attachment 330 [details]
Testcase
Comment 2 Sjors Gielen 2009-06-15 15:39:23 UTC
Created attachment 331 [details]
Sample file with which this bug occurs
Comment 3 Sjors Gielen 2009-06-15 16:13:03 UTC
Oops, this is caused by not calling SDL_SetVideoMode(). Added a note on this to the docwiki so it doesn't bite others... http://www.libsdl.org/cgi/docwiki.cgi/SDL_DisplayFormatAlpha