Skip to content

Commit

Permalink
Merge branch 'PHP-8.3'
Browse files Browse the repository at this point in the history
  • Loading branch information
devnexen committed Jan 9, 2024
2 parents fed9cf6 + 7d238bf commit b667616
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 4 deletions.
8 changes: 4 additions & 4 deletions ext/gd/gd.c
Original file line number Diff line number Diff line change
Expand Up @@ -2677,8 +2677,8 @@ static gdFontPtr php_find_gd_font(zend_object *font_obj, zend_long font_int)
*/
static void php_imagefontsize(INTERNAL_FUNCTION_PARAMETERS, int arg)
{
zend_object *font_obj;
zend_long font_int;
zend_object *font_obj = NULL;
zend_long font_int = 0;
gdFontPtr font;

ZEND_PARSE_PARAMETERS_START(1, 1)
Expand Down Expand Up @@ -2746,8 +2746,8 @@ static void php_imagechar(INTERNAL_FUNCTION_PARAMETERS, int mode)
int ch = 0, col, x, y, i, l = 0;
unsigned char *str = NULL;
zend_object *font_obj;
zend_long font_int;
gdFontPtr font;
zend_long font_int = 0;
gdFontPtr font = NULL;

ZEND_PARSE_PARAMETERS_START(6, 6)
Z_PARAM_OBJECT_OF_CLASS(IM, gd_image_ce)
Expand Down
Binary file added ext/gd/tests/gh13082.gdf
Binary file not shown.
16 changes: 16 additions & 0 deletions ext/gd/tests/gh13082.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
--TEST--
GH-13082 - imagefontwidth/height unexpectedly throwing an exception on a valid GdFont object.
--EXTENSIONS--
gd
--FILE--
<?php
$font = imageloadfont(__DIR__ . "/gh13082.gdf");
if ($font === false) die("imageloadfont failed");
if (!($font instanceof GdFont)) die("invalid gd font");

var_dump(imagefontwidth($font));
var_dump(imagefontheight($font));
?>
--EXPECT--
int(12)
int(20)

0 comments on commit b667616

Please sign in to comment.