Skip to content

Gd upd #17823

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 16, 2025
Merged

Gd upd #17823

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions ext/gd/gd.c
Original file line number Diff line number Diff line change
Expand Up @@ -167,9 +167,7 @@ PHP_GD_API gdImagePtr php_gd_libgdimageptr_from_zval_p(zval* zp)

zend_object *php_gd_image_object_create(zend_class_entry *class_type)
{
size_t block_len = sizeof(php_gd_image_object) + zend_object_properties_size(class_type);
php_gd_image_object *intern = emalloc(block_len);
memset(intern, 0, block_len);
php_gd_image_object *intern = zend_object_alloc(sizeof(php_gd_image_object), class_type);

zend_object_std_init(&intern->std, class_type);
object_properties_init(&intern->std, class_type);
Expand Down
4 changes: 2 additions & 2 deletions ext/gd/libgd/gd.c
Original file line number Diff line number Diff line change
Expand Up @@ -3190,8 +3190,8 @@ int gdImagePaletteToTrueColor(gdImagePtr src)
// Note: do not revert back to gdMalloc() below ; reason here,
// due to a bug with a certain memory_limit INI value treshold,
// imagepalettetotruecolor crashes with even unrelated ZendMM allocations.
// See GH-17772 for an use case.
src->tpixels = (int **) gdCalloc(sizeof(int *), sy);
// See GH-17772 for a use case.
src->tpixels = (int **) gdCalloc(sy, sizeof(int *));
if (src->tpixels == NULL) {
return 0;
}
Expand Down
Loading