summaryrefslogtreecommitdiff
path: root/ext/gd/gd.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/gd/gd.c')
-rw-r--r--ext/gd/gd.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ext/gd/gd.c b/ext/gd/gd.c
index 51b0d03044..8b8d8aa974 100644
--- a/ext/gd/gd.c
+++ b/ext/gd/gd.c
@@ -762,7 +762,7 @@ PHP_FUNCTION(imagesetstyle)
convert_to_array_ex(styles);
/* copy the style values in the stylearr */
- stylearr = emalloc(sizeof(int) * zend_hash_num_elements(HASH_OF(*styles)));
+ stylearr = safe_emalloc(sizeof(int), zend_hash_num_elements(HASH_OF(*styles)), 0);
zend_hash_internal_pointer_reset_ex(HASH_OF(*styles), &pos);
@@ -2572,7 +2572,7 @@ static void php_imagepolygon(INTERNAL_FUNCTION_PARAMETERS, int filled)
RETURN_FALSE;
}
- points = (gdPointPtr) emalloc(npoints * sizeof(gdPoint));
+ points = (gdPointPtr) safe_emalloc(npoints, sizeof(gdPoint), 0);
for (i = 0; i < npoints; i++) {
if (zend_hash_index_find(Z_ARRVAL_PP(POINTS), (i * 2), (void **) &var) == SUCCESS) {