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 1407

Summary: Potential misuse of memcmp in SDL_AddDisplayMode
Product: SDL Reporter: Tim Angus <tim>
Component: videoAssignee: Ryan C. Gordon <icculus>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: minor    
Priority: P2 CC: icculus
Version: HG 2.0Keywords: target-2.0.0
Hardware: All   
OS: All   

Description Tim Angus 2012-01-31 07:40:44 UTC
When I was looking at bug #1394, I noticed that in SDL_AddDisplayMode[SDL_video.c], modes are compared by value using SDL_memcmp in order to avoid adding the same display mode twice. My concern is that since SDL_DisplayMode has the member "void *driverdata", you could potentially get into the situation where you're comparing two modes which are logically identical, but literally different if their driverdata members point to different things.

I haven't actually seen this happen, it just looked as if it might potentially be a problem.
Comment 1 Ryan C. Gordon 2013-07-12 22:15:35 UTC
(Sorry if you get a lot of copies of this email, we're touching dozens of bug reports right now.)

Tagging a bunch of bugs as target-2.0.0, Priority 2.

This means we're in the final stretch for an official SDL 2.0.0 release! These are the bugs we really want to fix before shipping if humanly possible.

That being said, we don't promise to fix them because of this tag, we just want to make sure we don't forget to deal with them before we bless a final 2.0.0 release, and generally be organized about what we're aiming to ship.

Hopefully you'll hear more about this bug soon. If you have more information (including "this got fixed at some point, nevermind"), we would love to have you come add more information to the bug report when you have a moment.

Thanks!
--ryan.
Comment 2 Ryan C. Gordon 2013-07-13 21:51:16 UTC
Good catch; fixed in hg changeset f52afd324ec7, thanks!

--ryan.