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 622 - windib sets SDL_HWPALETTE for >8 bit video modes; segfaults in SetGammaRamp
Summary: windib sets SDL_HWPALETTE for >8 bit video modes; segfaults in SetGammaRamp
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: video (show other bugs)
Version: 1.2.13
Hardware: x86 Windows (All)
: P2 normal
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords: target-1.2.14
Depends on:
Blocks:
 
Reported: 2008-09-04 17:55 UTC by Gregory Smith
Modified: 2009-09-26 22:40 UTC (History)
1 user (show)

See Also:


Attachments
dib-hwpalette-fix.patch (462 bytes, patch)
2008-09-04 17:56 UTC, Gregory Smith
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Gregory Smith 2008-09-04 17:55:41 UTC
windib appears to always set the SDL_HWPALETTE flag in SetVideoMode, even when the bit depth is greater than 8. This can cause a segfault when SetGammaRamp is called, as it blindly tries to dereference the non-existent palette's colors.

I think the line video->flags |= SDL_HWPALETTE should be inside the scope of the preceeding if statement, as in the attached patch.
Comment 1 Gregory Smith 2008-09-04 17:56:47 UTC
Created attachment 272 [details]
dib-hwpalette-fix.patch

I think this will fix the bug
Comment 2 Ryan C. Gordon 2009-09-13 16:33:29 UTC
Tagging this bug with "target-1.2.14" so we can try to resolve it for SDL 1.2.14.

Please note that we may choose to resolve it as WONTFIX. This tag is largely so we have a comprehensive wishlist of bugs to examine for 1.2.14 (and so we can close bugs that we'll never fix, rather than have them live forever in Bugzilla).

--ryan.
Comment 3 Sam Lantinga 2009-09-26 22:40:05 UTC
This is already fixed in subversion.  Thanks!