malloc+memset == calloc (sync with libgd)

This commit is contained in:
Nuno Lopes 2007-06-17 19:03:58 +00:00
parent fcd0a1e790
commit 74474a1ef8

View File

@ -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);