kwo pushed a commit to branch master.

http://git.enlightenment.org/legacy/imlib2.git/commit/?id=ecfe46cc4a70407c0107a8c7d84e457edacadaf7

commit ecfe46cc4a70407c0107a8c7d84e457edacadaf7
Author: Yuriy M. Kaminskiy <yum...@gmail.com>
Date:   Wed Apr 6 06:17:38 2016 +0300

    loader_xpm: remove nonsense/impossible/broken condition
    
    1) ptr is DATA32 *, so (ptr-im->data) is (w * h) at most;
    so this condition was broken, it should've been ((ptr-im->data) >= w*h);
    2) ... however, ptr != NULL and (context > 1) are only possible together,
    and ptr and count are incremented always together too, so
    there are no point to check both; leave only less expensive check.
---
 src/modules/loaders/loader_xpm.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/src/modules/loaders/loader_xpm.c b/src/modules/loaders/loader_xpm.c
index d7cca75..5379a2f 100644
--- a/src/modules/loaders/loader_xpm.c
+++ b/src/modules/loaders/loader_xpm.c
@@ -510,8 +510,7 @@ load(ImlibImage * im, ImlibProgressFunction progress, char 
progress_granularity,
              line = realloc(line, lsz);
           }
 
-        if (((ptr) && ((ptr - im->data) >= (w * h * (int)sizeof(DATA32)))) ||
-            ((context > 1) && (count >= pixels)))
+        if ((context > 1) && (count >= pixels))
            done = 1;
      }
 

-- 


Reply via email to