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:
Ralph Siemsen 2018-04-17 14:51:03 -04:00 committed by Kim Woelders
parent c63f7a3a63
commit 4fc4a6ad77
1 changed files with 1 additions and 1 deletions

View File

@ -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);