| Summary: | SDL_bmp.c crashes on headers with negative height values | ||
|---|---|---|---|
| Product: | SDL | Reporter: | Eric Wing <ewing.bug.sdl> |
| Component: | video | Assignee: | Sam Lantinga <slouken> |
| Status: | RESOLVED FIXED | QA Contact: | Sam Lantinga <slouken> |
| Severity: | critical | ||
| Priority: | P2 | CC: | ewmailing, renesd, sezeroz |
| Version: | 1.2.13 | Keywords: | target-1.2.14 |
| Hardware: | All | ||
| OS: | All | ||
| URL: | http://www.assembla.com/spaces/SDL_Clipboard | ||
| Attachments: |
negative height/width in bmp loading.
fixes to SDL_bmp.c for negative height |
||
|
Description
Eric Wing
2009-04-07 08:07:11 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. Created attachment 359 [details]
negative height/width in bmp loading.
ah, this explains my issues with SDL and OSX bmp files. This is an important fix for pygame too.
There's no patch attached to this bug. I assume this was forgotten to be attached?
I've attached an SDL_bmp2.c that 'Kenneth Bull' sent to the mailing list.
"""
Subject: Re: [SDL] SDL_Loadbmp fail
Try the attached file (not thoroughly tested, but compiles without warnings
with gcc -c SDL_bmp2.c `pkg-config sdl --cflags`).
I renamed SDL_LoadBMP_RW and SDL_SaveBMP_RW so you can test it without
recompiling SDL. This is for 1.2, not 1.3.
This should also work better for BITMAPV4HEADER and BITMAPV5HEADER bitmaps.
"""
Updated to critical, as this is also a security vulnerability. Created attachment 360 [details]
fixes to SDL_bmp.c for negative height
Sorry, I forgot to explicitly state where my fix was located. It is in my aforementioned repository under the FixesToSDL subdirectory. http://trac-hg.assembla.com/SDL_Clipboard/browser/FixesToSDL/SDL_bmp.c I have attached my file here for convenience. This is fixed for SDL 1.2, 1.3, and SDL_image. Thanks! |