diff options
author | Ilia Alshanetsky <iliaa@php.net> | 2002-11-25 01:51:53 +0000 |
---|---|---|
committer | Ilia Alshanetsky <iliaa@php.net> | 2002-11-25 01:51:53 +0000 |
commit | 9251486567c9a12e318c9de73da3703033c7e84b (patch) | |
tree | 2788199ac6b3ec85b56a0cffc5f3a773b5d8c06e /ext/gd/libgd/gdxpm.c | |
parent | 5c851cba19221b9e03c34afdbd8396a7f5f9b6bf (diff) | |
download | php-git-9251486567c9a12e318c9de73da3703033c7e84b.tar.gz |
Synchronized bundled gd library with the latest stable GD, 2.0.6
Fixed a configuration problem with xpm.
Fixed 2 possible memory leaks in fontFetch().
Diffstat (limited to 'ext/gd/libgd/gdxpm.c')
-rw-r--r-- | ext/gd/libgd/gdxpm.c | 20 |
1 files changed, 4 insertions, 16 deletions
diff --git a/ext/gd/libgd/gdxpm.c b/ext/gd/libgd/gdxpm.c index b7eb92e333..bd346bbc06 100644 --- a/ext/gd/libgd/gdxpm.c +++ b/ext/gd/libgd/gdxpm.c @@ -7,21 +7,13 @@ */ #include <stdio.h> #include <stdlib.h> +#include <string.h> #include "gd.h" #include "gdhelpers.h" -#ifndef HAVE_XPM -gdImagePtr -gdImageCreateFromXpm (char *filename) -{ - fprintf (stderr, "libgd was not built with xpm support\n"); - return (NULL); -} - -#else +#ifdef HAVE_XPM -#include "xpm.h" -#include <string.h> +#include <X11/xpm.h> gdImagePtr gdImageCreateFromXpm (char *filename) @@ -46,8 +38,6 @@ gdImageCreateFromXpm (char *filename) number = image.ncolors; colors = (int *) gdMalloc (sizeof (int) * number); - if (colors == NULL) - return (0); for (i = 0; i < number; i++) { switch (strlen (image.colorTable[i].c_color)) @@ -129,11 +119,9 @@ gdImageCreateFromXpm (char *filename) } apixel = (char *) gdMalloc (image.cpp + 1); - if (apixel == NULL) - return (0); apixel[image.cpp] = '\0'; - pointer = image.data; + pointer = (int *) image.data; for (i = 0; i < image.height; i++) { for (j = 0; j < image.width; j++) |