#181 Bug in ilGetClear

open
nobody
None
5
2009-06-23
2009-06-23
Anonymous
No

In function ilGetClear on line 313 ff. in File il_devil.c there is a bug. The present code is:

case IL_LUMINANCE:
BytePtr[0] = (ILubyte)(ClearAlpha * UCHAR_MAX);
break;

case IL_LUMINANCE_ALPHA:
BytePtr[0] = (ILubyte)(ClearLum * UCHAR_MAX);
BytePtr[1] = (ILubyte)(ClearAlpha * UCHAR_MAX);

case IL_COLOUR_INDEX:

It shoud be:

case IL_LUMINANCE:
BytePtr[0] = (ILubyte)(ClearLum * UCHAR_MAX); // correction
break;

case IL_LUMINANCE_ALPHA:
BytePtr[0] = (ILubyte)(ClearLum * UCHAR_MAX);
BytePtr[1] = (ILubyte)(ClearAlpha * UCHAR_MAX);
break; // correction

case IL_COLOUR_INDEX:

Discussion