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 - SDL_Rect
Summary: SDL_Rect
Status: RESOLVED FIXED
Alias: None
Product: SDL_image
Classification: Unclassified
Component: misc (show other bugs)
Version: 2.0.1
Hardware: x86_64 Windows 7
: P2 normal
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-12-18 10:53 UTC by dobre.dani.alias
Modified: 2016-12-18 11:08 UTC (History)
0 users

See Also:


Attachments
Shows the values of sdlRect1 at different execution times. (226.06 KB, image/png)
2016-12-18 10:53 UTC, dobre.dani.alias
Details

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