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 3526

Summary: SDL_Rect
Product: SDL_image Reporter: dobre.dani.alias
Component: miscAssignee: Sam Lantinga <slouken>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2    
Version: 2.0.1   
Hardware: x86_64   
OS: Windows 7   
Attachments: Shows the values of sdlRect1 at different execution times.

Description dobre.dani.alias 2016-12-18 10:53:23 UTC
Created attachment 2651 [details]
Shows the values of sdlRect1 at different execution times.

Two SDL_Rect pointers are declared, the first one is initialised, then the second one. When the second SDL_Rect struct is initialised, the first one has its values overwritten with gibberish.

            SDL_Rect *sdlRect1;

            sdlRect1->x = 10;
            sdlRect1->y = 10;
            sdlRect1->w = 70;
            sdlRect1->h = 60;

            SDL_Rect *sdlRect2;
            sdlRect2->x = 10;
            sdlRect2->y = 10;
            sdlRect2->w = 70;
            sdlRect2->h = 60;
Comment 1 dobre.dani.alias 2016-12-18 11:08:41 UTC
I should have used 'new SDL_Rect'!