summaryrefslogtreecommitdiff
path: root/ext/gd/libgd
diff options
context:
space:
mode:
Diffstat (limited to 'ext/gd/libgd')
-rw-r--r--ext/gd/libgd/gd.c14
-rw-r--r--ext/gd/libgd/gd_png.c2
-rw-r--r--ext/gd/libgd/gdft.c3
-rw-r--r--ext/gd/libgd/xbm.c4
4 files changed, 12 insertions, 11 deletions
diff --git a/ext/gd/libgd/gd.c b/ext/gd/libgd/gd.c
index a0ea6f198..e4e2e0f1a 100644
--- a/ext/gd/libgd/gd.c
+++ b/ext/gd/libgd/gd.c
@@ -2568,7 +2568,7 @@ void gdImagePolygon (gdImagePtr im, gdPointPtr p, int n, int c)
typedef void (*image_line)(gdImagePtr im, int x1, int y1, int x2, int y2, int color);
image_line draw_line;
- if (!n) {
+ if (n <= 0) {
return;
}
@@ -2614,14 +2614,14 @@ void gdImageFilledPolygon (gdImagePtr im, gdPointPtr p, int n, int c)
{
int i;
int y;
- int miny, maxy;
+ int miny, maxy, pmaxy;
int x1, y1;
int x2, y2;
int ind1, ind2;
int ints;
int fill_color;
- if (!n) {
+ if (n <= 0) {
return;
}
@@ -2658,7 +2658,7 @@ void gdImageFilledPolygon (gdImagePtr im, gdPointPtr p, int n, int c)
maxy = p[i].y;
}
}
-
+ pmaxy = maxy;
/* 2.0.16: Optimization by Ilia Chipitsine -- don't waste time offscreen */
if (miny < 0) {
miny = 0;
@@ -2700,13 +2700,13 @@ void gdImageFilledPolygon (gdImagePtr im, gdPointPtr p, int n, int c)
*/
if (y >= y1 && y < y2) {
im->polyInts[ints++] = (float) ((y - y1) * (x2 - x1)) / (float) (y2 - y1) + 0.5 + x1;
- } else if (y == maxy && y > y1 && y <= y2) {
- im->polyInts[ints++] = (float) ((y - y1) * (x2 - x1)) / (float) (y2 - y1) + 0.5 + x1;
+ } else if (y == pmaxy && y == y2) {
+ im->polyInts[ints++] = x2;
}
}
qsort(im->polyInts, ints, sizeof(int), gdCompareInt);
- for (i = 0; i < ints; i += 2) {
+ for (i = 0; i < ints - 1; i += 2) {
gdImageLine(im, im->polyInts[i], y, im->polyInts[i + 1], y, fill_color);
}
}
diff --git a/ext/gd/libgd/gd_png.c b/ext/gd/libgd/gd_png.c
index da5a32f68..52a087e78 100644
--- a/ext/gd/libgd/gd_png.c
+++ b/ext/gd/libgd/gd_png.c
@@ -145,7 +145,7 @@ gdImagePtr gdImageCreateFromPngCtx (gdIOCtx * infile)
return NULL;
}
- if (!png_check_sig (sig, 8)) { /* bad signature */
+ if (png_sig_cmp(sig, 0, 8) != 0) { /* bad signature */
return NULL;
}
diff --git a/ext/gd/libgd/gdft.c b/ext/gd/libgd/gdft.c
index ffac3ebf6..a3ced0ab1 100644
--- a/ext/gd/libgd/gdft.c
+++ b/ext/gd/libgd/gdft.c
@@ -1090,6 +1090,7 @@ gdImageStringFTEx (gdImage * im, int *brect, int fg, char *fontlist, double ptsi
if (render) {
if (image->format != ft_glyph_format_bitmap && FT_Glyph_To_Bitmap(&image, ft_render_mode_normal, 0, 1)) {
+ FT_Done_Glyph(image);
if (tmpstr) {
gdFree(tmpstr);
}
@@ -1100,7 +1101,7 @@ gdImageStringFTEx (gdImage * im, int *brect, int fg, char *fontlist, double ptsi
/* now, draw to our target surface */
bm = (FT_BitmapGlyph) image;
- gdft_draw_bitmap(tc_cache, im, fg, bm->bitmap, x + x1 + ((pen.x + 31) >> 6) + bm->left, y + y1 + ((pen.y + 31) >> 6) - bm->top);
+ gdft_draw_bitmap(tc_cache, im, fg, bm->bitmap, x + x1 + ((pen.x + 31) >> 6), y + y1 + ((pen.y + 31) >> 6) - bm->top);
}
/* record current glyph index for kerning */
diff --git a/ext/gd/libgd/xbm.c b/ext/gd/libgd/xbm.c
index 983163ae5..053d22315 100644
--- a/ext/gd/libgd/xbm.c
+++ b/ext/gd/libgd/xbm.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2009 The PHP Group |
+ | Copyright (c) 1997-2010 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: xbm.c 272370 2008-12-31 11:15:49Z sebastian $ */
+/* $Id: xbm.c 293036 2010-01-03 09:23:27Z sebastian $ */
#include <stdio.h>
#include <math.h>