Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#202 wrong code in "ilReadRLE4Bmp"?

open
nobody
None
5
2014-08-15
2011-07-19
tsuui
No

----------------code---------------- in 'ilReadRLE4Bmp()' @ il_bmp.c
...

count = IL_MIN (Bytes[1], iCurImage->SizeOfData-offset);

for (i = 0; i < count; i++) {
int byte;

if ((i & 0x01) == 0) {
if (iread(&Bytes[0], sizeof(Bytes[0]), 1) != 1)
return IL_FALSE;
byte = (Bytes[0] >> 4);
}
else
byte = (Bytes[0] & 0x0F);
iCurImage->Data[offset++] = byte;
}

align = Bytes[1] % 4; // 'Bytes[1]' should be changed to 'count' ? <<<<<<<<<<<<<<<

if (align == 1 || align == 2) // Must be on a word boundary
if (iread(&Bytes[0], sizeof(Bytes[0]), 1) != 1)
return IL_FALSE;
...
----------------code----------------

as I commented, thanks

-- tsuui

Discussion

  • tsuui
    tsuui
    2011-07-19

    this is found under revision 1678, in file 'il_bmp.c'