summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYuriy M. Kaminskiy <yumkam@gmail.com>2016-04-06 06:17:38 +0300
committerKim Woelders <kim@woelders.dk>2016-04-12 20:00:56 +0200
commitecfe46cc4a70407c0107a8c7d84e457edacadaf7 (patch)
tree2d5fa0293c37ce2f31cce69bba85e7bbae6ca2d8
parent7eba2e4c8ac0e20838947f10f29d0efe1add8227 (diff)
downloadimlib2-ecfe46cc4a70407c0107a8c7d84e457edacadaf7.tar.gz
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.
-rw-r--r--src/modules/loaders/loader_xpm.c3
1 files changed, 1 insertions, 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;
}