Open TheHugeManatee opened 7 years ago
See https://github.com/TheHugeManatee/DevIL/commit/a951650e59ca575d6f5bdca9fc84e47ce0b66e8c 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..
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. test.zip