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)
167167
168168zend_object * php_gd_image_object_create (zend_class_entry * class_type )
169169{
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 );
173171
174172 zend_object_std_init (& intern -> std , class_type );
175173 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)
31903190 // Note: do not revert back to gdMalloc() below ; reason here,
31913191 // due to a bug with a certain memory_limit INI value treshold,
31923192 // 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 * ));
31953195 if (src -> tpixels == NULL ) {
31963196 return 0 ;
31973197 }
You can’t perform that action at this time.
0 commit comments