forked from old/legacy-imlib2
loader_tga: fix regression in RLE raw byte handling
Commit 6ef51ec4cd
added some cleanup
logic, however it introduced an off-by-one bug for raw bytes in RLE.
It looks like a copy'n'paste problem:
- the check on line 426 is correct, however
- the check on line 481 has an erronous "+ 1"
In the second case, "bufptr" has already been incremented, so the
extra "+ 1" is not needed.
This bug causes some legitimate TGA files to fail to load, on the
very last pixel...
This commit is contained in:
parent
c63f7a3a63
commit
4fc4a6ad77
|
@ -488,7 +488,7 @@ load(ImlibImage * im, ImlibProgressFunction progress,
|
|||
|
||||
for (i = 0; (i < count) && (dataptr < final_pixel); i++)
|
||||
{
|
||||
if ((bufptr + 1 + (bpp / 8)) > bufend)
|
||||
if ((bufptr + bpp / 8) > bufend)
|
||||
{
|
||||
munmap(seg, ss.st_size);
|
||||
free(im->data);
|
||||
|
|
Loading…
Reference in New Issue