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 984

Summary: SDL_CreateTexture allows the creation of textures of size 0, which can lead to div by 0 errors
Product: SDL Reporter: Mason Wheeler <masonwheeler>
Component: videoAssignee: Ryan C. Gordon <icculus>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: major    
Priority: P2    
Version: 2.0.0   
Hardware: All   
OS: All   

Description Mason Wheeler 2010-04-15 21:03:56 UTC
The summary pretty much says it all.  When you go to render a texture, (at least on the GL renderer, and it's probably the same for D3D, not sure about the others,) it needs to perform division operations with the divisors being the height and width of the texture.  If your height or width is 0, well... you can guess what would happen.

The appropriate remedy would be to have SDL_CreateTexture fail and give an error if either the height or the width passed to is is 0.
Comment 1 Sam Lantinga 2010-04-15 21:27:34 UTC
This is fixed, thanks!

changeset:   4433:9fa97c6b0014
tag:         tip
user:        Sam Lantinga <slouken@libsdl.org>
date:        Thu Apr 15 21:27:32 2010 -0700
summary:     Fixed bug 984