Possible divide by 0 error with texture rendering

If you create a texture with either dimension as 0, (which doesn’t make any sense anyway,) it can lead to an error when the RenderCopy routine tries to divide by the dimensions of the texture. The obvious fix is to have SDL_CreateTexture fail and return an error if either of the dimensions you pass to it is 0.

Reported as http://bugzilla.libsdl.org/show_bug.cgi?id=984

Fixed, thanks!On Thu, Apr 15, 2010 at 9:07 PM, Mason Wheeler wrote:

If you create a texture with either dimension as 0, (which doesn’t make any sense anyway,) it can lead to an error when the RenderCopy routine tries to divide by the dimensions of the texture. ?The obvious fix is to have SDL_CreateTexture fail and return an error if either of the dimensions you pass to it is 0.

Reported as http://bugzilla.libsdl.org/show_bug.cgi?id=984


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


-Sam Lantinga, Founder and President, Galaxy Gameworks LLC