summaryrefslogtreecommitdiff
path: root/ext/gd/libgd
diff options
context:
space:
mode:
authorIlia Alshanetsky <iliaa@php.net>2003-11-04 01:55:50 +0000
committerIlia Alshanetsky <iliaa@php.net>2003-11-04 01:55:50 +0000
commitb520c9d42c34c30c353cc93579c92ab30f629ff4 (patch)
tree0f79ccfea924dd3e623c222958a99129f9ed09f6 /ext/gd/libgd
parent6d5ddf6b78ab5a3949dbf654b41522dbe7403ee0 (diff)
downloadphp-git-b520c9d42c34c30c353cc93579c92ab30f629ff4.tar.gz
Fixed bug #26097 (gdImageColorClosestAlpha() returns incorrect results).
Diffstat (limited to 'ext/gd/libgd')
-rw-r--r--ext/gd/libgd/gd.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ext/gd/libgd/gd.c b/ext/gd/libgd/gd.c
index 540605a9a5..9b9413320c 100644
--- a/ext/gd/libgd/gd.c
+++ b/ext/gd/libgd/gd.c
@@ -255,7 +255,7 @@ int gdImageColorClosestAlpha (gdImagePtr im, int r, int g, int b, int a)
gd = im->green[i] - g;
bd = im->blue[i] - b;
/* gd 2.02: whoops, was - b (thanks to David Marwood) */
- ad = im->blue[i] - a;
+ ad = im->alpha[i] - a;
dist = rd * rd + gd * gd + bd * bd + ad * ad;
if (first || (dist < mindist)) {
mindist = dist;