diff options
| author | Nuno Lopes <nlopess@php.net> | 2007-06-17 19:03:58 +0000 |
|---|---|---|
| committer | Nuno Lopes <nlopess@php.net> | 2007-06-17 19:03:58 +0000 |
| commit | 74474a1ef89efcf841868c5e0fba6322dad1646b (patch) | |
| tree | 04372d07e6783741af2e30fb1b78c62705615cdd | |
| parent | fcd0a1e790c25b357be50d3105b3ef20a3a1a5cd (diff) | |
| download | php-git-74474a1ef89efcf841868c5e0fba6322dad1646b.tar.gz | |
malloc+memset == calloc (sync with libgd)
| -rw-r--r-- | ext/gd/libgd/gd.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/ext/gd/libgd/gd.c b/ext/gd/libgd/gd.c index 9119a00b08..301072f4e7 100644 --- a/ext/gd/libgd/gd.c +++ b/ext/gd/libgd/gd.c @@ -129,8 +129,8 @@ gdImagePtr gdImageCreate (int sx, int sy) return NULL; } - im = (gdImage *) gdMalloc(sizeof(gdImage)); - memset(im, 0, sizeof(gdImage)); + im = (gdImage *) gdCalloc(1, sizeof(gdImage)); + /* Row-major ever since gd 1.3 */ im->pixels = (unsigned char **) gdMalloc(sizeof(unsigned char *) * sy); im->AA_opacity = (unsigned char **) gdMalloc(sizeof(unsigned char *) * sy); |
