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 2957

Summary: De-reference rz_src without NULL check in SDLgfx_rotateSurface function
Product: SDL Reporter: Nitz <nitin.j4>
Component: renderAssignee: Sam Lantinga <slouken>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: major    
Priority: P2    
Version: 2.0.3   
Hardware: x86   
OS: Linux   
Attachments: Patch for rz_src NULL check

Description Nitz 2015-04-23 06:37:11 UTC
Created attachment 2130 [details]
Patch for rz_src NULL check

In function SDLgfx_rotateSurface:

rz_dst =
            SDL_CreateRGBSurface(SDL_SWSURFACE, dstwidth, dstheight + GUARD_ROWS, 
            rz_src->format->Rmask, rz_src->format->Gmask,
            rz_src->format->Bmask, rz_src->format->Amask);

Here rz_src get De-referenced without NULL check, which is risky.

Patch is attached for rz_src NULL check.
Comment 1 Sam Lantinga 2016-10-08 00:30:39 UTC
Fixed, thanks!
https://hg.libsdl.org/SDL/rev/63cc8dcc2ef9