Skip to content

Commit b667616

Browse files
committed
Merge branch 'PHP-8.3'
2 parents fed9cf6 + 7d238bf commit b667616

File tree

3 files changed

+20
-4
lines changed

3 files changed

+20
-4
lines changed

ext/gd/gd.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2677,8 +2677,8 @@ static gdFontPtr php_find_gd_font(zend_object *font_obj, zend_long font_int)
26772677
*/
26782678
static void php_imagefontsize(INTERNAL_FUNCTION_PARAMETERS, int arg)
26792679
{
2680-
zend_object *font_obj;
2681-
zend_long font_int;
2680+
zend_object *font_obj = NULL;
2681+
zend_long font_int = 0;
26822682
gdFontPtr font;
26832683

26842684
ZEND_PARSE_PARAMETERS_START(1, 1)
@@ -2746,8 +2746,8 @@ static void php_imagechar(INTERNAL_FUNCTION_PARAMETERS, int mode)
27462746
int ch = 0, col, x, y, i, l = 0;
27472747
unsigned char *str = NULL;
27482748
zend_object *font_obj;
2749-
zend_long font_int;
2750-
gdFontPtr font;
2749+
zend_long font_int = 0;
2750+
gdFontPtr font = NULL;
27512751

27522752
ZEND_PARSE_PARAMETERS_START(6, 6)
27532753
Z_PARAM_OBJECT_OF_CLASS(IM, gd_image_ce)

ext/gd/tests/gh13082.gdf

52.5 KB
Binary file not shown.

ext/gd/tests/gh13082.phpt

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
--TEST--
2+
GH-13082 - imagefontwidth/height unexpectedly throwing an exception on a valid GdFont object.
3+
--EXTENSIONS--
4+
gd
5+
--FILE--
6+
<?php
7+
$font = imageloadfont(__DIR__ . "/gh13082.gdf");
8+
if ($font === false) die("imageloadfont failed");
9+
if (!($font instanceof GdFont)) die("invalid gd font");
10+
11+
var_dump(imagefontwidth($font));
12+
var_dump(imagefontheight($font));
13+
?>
14+
--EXPECT--
15+
int(12)
16+
int(20)

0 commit comments

Comments
 (0)