Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
ilCopyPixels crashes loading RGBA-paletted bmps as luminance images #56
ilCopyPixels() will crash when copying a bmp image with an RGBA/BGRA-palette as IL_LUMINANCE
Debugging shows this is a problem of iConvertPalette(), where a palette with bpp=4 is not treated correctly, causing an integer to underflow.
sample image is attached.
See TheHugeManatee@a951650 for a possible fix. This would do fine for now, preventing j to underflow for Size >= 4 but will not be robust for color palettes with bpp other than 3 or 4. Currently, ilGetBppPal() only returns 0, 3 or 4, where 0 still will result in an indefinite loop..