DentonW / DevIL

Developer's Image Library (DevIL) is a cross-platform image library utilizing a simple syntax to load, save, convert, manipulate, filter, and display a variety of images with ease. It is highly portable and has been ported to several platforms.
http://openil.sourceforge.net/
GNU Lesser General Public License v2.1
446 stars 138 forks source link

Issue in Rotating Non Square Images 90 degrees #24

Open saneeshkumar opened 9 years ago

saneeshkumar commented 9 years ago

I am trying to rotate an image (height greater than width) 90 degree. In the below code it crashes in the function "ILAPI ILimage* ILAPIENTRY iluRotate_(ILimage *Image, ILfloat Angle)".

Consider the image width = 50, and height = 100. So when X=0, Y = 50, RotOffset will be "-1" after executing "RotOffset = x * Rotated->Bps + (Image->Width - 1 - y) * Rotated->Bpp;" Since "RotOffset " is unsigned int, subsequent array access "Rotated->Data[RotOffset + c]" will fail.