Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ilCopyPixels crashes loading RGBA-paletted bmps as luminance images #56

TheHugeManatee opened this issue Feb 7, 2017 · 1 comment


Copy link

commented Feb 7, 2017

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.


This comment has been minimized.

Copy link

commented Feb 7, 2017

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..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
1 participant
You can’t perform that action at this time.