I've found 2 bugs with BMP support.
Firstly, for 32bpp images the alpha channel can be replaced with uninitialised memory.
Secondly, for 24bpp images are incorrectly padded.
The fix for this is appended. I don't know how I go about getting write access to the source - so perhaps someone would apply this on my behalf.
cvs diff -- ilut_win32.c (in directory C:\rcharlton\DevIl-CVS\DevIL\src-ILUT\src\)
RCS file: /cvsroot/openil/DevIL/src-ILUT/src/ilut_win32.c,v
retrieving revision 1.27
diff -r1.27 ilut_win32.c
> // Copy the alpha channel if present.
> if (Image->Bpp == 4)
> TempBuff[i+3] = TempData[i+3];
< NewData = (ILubyte*)ialloc((Image->Width + PadSize) * Image->Height * Image->Bpp);
> NewData = (ILubyte*)ialloc((Image->Bps + PadSize) * Image->Height);
< NewBps = ilutCurImage->Bps/* + Padding*/;
> NewBps = ilutCurImage->Bps + Padding;
Thanks for the patch. Sorry that it took awhile for it to be applied.
Log in to post a comment.