File tree Expand file tree Collapse file tree 2 files changed +3
-5
lines changed Expand file tree Collapse file tree 2 files changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -167,9 +167,7 @@ PHP_GD_API gdImagePtr php_gd_libgdimageptr_from_zval_p(zval* zp)
167
167
168
168
zend_object * php_gd_image_object_create (zend_class_entry * class_type )
169
169
{
170
- size_t block_len = sizeof (php_gd_image_object ) + zend_object_properties_size (class_type );
171
- php_gd_image_object * intern = emalloc (block_len );
172
- memset (intern , 0 , block_len );
170
+ php_gd_image_object * intern = zend_object_alloc (sizeof (php_gd_image_object ), class_type );
173
171
174
172
zend_object_std_init (& intern -> std , class_type );
175
173
object_properties_init (& intern -> std , class_type );
Original file line number Diff line number Diff line change @@ -3190,8 +3190,8 @@ int gdImagePaletteToTrueColor(gdImagePtr src)
3190
3190
// Note: do not revert back to gdMalloc() below ; reason here,
3191
3191
// due to a bug with a certain memory_limit INI value treshold,
3192
3192
// imagepalettetotruecolor crashes with even unrelated ZendMM allocations.
3193
- // See GH-17772 for an use case.
3194
- src -> tpixels = (int * * ) gdCalloc (sizeof (int * ), sy );
3193
+ // See GH-17772 for a use case.
3194
+ src -> tpixels = (int * * ) gdCalloc (sy , sizeof (int * ));
3195
3195
if (src -> tpixels == NULL ) {
3196
3196
return 0 ;
3197
3197
}
You can’t perform that action at this time.
0 commit comments