Hello Ralph,
I actually sent two replies to your patch sent to me on April 17:
--------------
#1 - April 19:
Thanks, I'll be looking into this shortly.
It would be very helpful if you could send me one or more images that
demonstrate the problem that I can use for testing.
/Kim
--------------
#2 - April 23:
Actually, it seems to me that the "+ 1" is correct as we access a
"curbyte" + (bpp / 8) pixel value bytes, right?
Maybe the problem is elsewhere - if you have an image causing trouble
you can send me I can look into it.
/Kim
--------------
I guess there is or was a problem with some mail server somewhere.
Isn't imlib2 registered as a project i phabricator here:
https://phab.enlightenment.org/project/view/198/ ?
/Kim
On 05/02/2018 02:45 AM, Ralph Siemsen wrote:
Below is a patch for imlib2 TGA image loader, which fixes a regression
in loading of RLE-encoded files. This patch is based on the current
git head of the imlib2 repo.
Additionally, I could not find an entry for imlib2 in Phabricator,
so I am unable to create a patch using Arcanist.
Cheers,
Ralph
commit 32ca1bdd57f35de08075096f3148d13582545731
Author: Ralph Siemsen <[email protected]>
Date: Tue Apr 17 14:51:03 2018 -0400
loader_tga: fix regression in RLE raw byte handling
Commit 6ef51ec4cd6e9c8755a377699938c59757258f8d 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...
diff --git a/src/modules/loaders/loader_tga.c b/src/modules/loaders/loader_tga.c
index 988b6ce..fe6165d 100644
--- a/src/modules/loaders/loader_tga.c
+++ b/src/modules/loaders/loader_tga.c
@@ -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);
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
enlightenment-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel