| Summary: | SDL_CreateTexture allows illegal texture sizes | ||
|---|---|---|---|
| Product: | SDL | Reporter: | Lloyd Bryant <lloydbaz> |
| Component: | render | Assignee: | Sam Lantinga <slouken> |
| Status: | RESOLVED FIXED | QA Contact: | Sam Lantinga <slouken> |
| Severity: | minor | ||
| Priority: | P2 | CC: | philipp.wiesemann |
| Version: | HG 2.0 | ||
| Hardware: | x86 | ||
| OS: | Linux | ||
| Attachments: |
patch to enforce maximum size limits for SDL_CreateTexture()
Test case Patch - enforce texture size limits for SDL_CreateTexture() |
||
Created attachment 1345 [details]
Test case
Here's a simple program to demonstrate the bug
The error message contains a typo ("dimenions" [sic]).
Created attachment 1347 [details]
Patch - enforce texture size limits for SDL_CreateTexture()
OK - take two on the patch, with that spelling error corrected.
Fixed, thanks! http://hg.libsdl.org/SDL/rev/28031e0042b2 |
Created attachment 1344 [details] patch to enforce maximum size limits for SDL_CreateTexture() SDL_CreateTexture() is succeeding (i.e. returning a valid pointer) when the requested horizontal or vertical size of the texture exceeds the maximum allowed by the render. This results in hard-to-understand errors showing up when later attempting to use that texture (such as with SDL_SetRenderTarget()). I'm attaching a patch to explicitly check these values against the render's maximums, and returning NULL and setting a meaningful error message if those limits are exceeded. Patch was created with "hg diff", relative to the top level directory. I also have a test case written up, but haven't figured out how to attach it and the patch at the same time...