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 1929

Summary: SDL_Texture* from SDL_CreateTexture() causes GL_BindTexture() to segfault
Product: SDL Reporter: Charles Huber <genpfault>
Component: videoAssignee: Sam Lantinga <slouken>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: major    
Priority: P2    
Version: HG 2.0   
Hardware: x86_64   
OS: Linux   
Attachments: Demo program

Description Charles Huber 2013-06-25 21:45:40 UTC
Created attachment 1197 [details]
Demo program

If SDL_CreateTexture() takes the !IsSupportedFormat() path it will return a SDL_Texture* with a NULL driverdata member.

If you then SDL_GL_BindTexture() this will cause a segfault in GL_BindTexture() when it unconditionally dereferences driverdata.

Debian Wheezy, binary Radeon drivers on a "AMD Radeon HD 6900 Series".

SDL2 built from "changeset: 7317:37b77749523b".
Comment 1 Sam Lantinga 2013-06-25 23:22:04 UTC
Fixed, thanks for the report!
http://hg.libsdl.org/SDL/rev/46a5a6b8678e