File tree 1 file changed +7
-7
lines changed
1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -1443,6 +1443,13 @@ PHP_FUNCTION(imageloadfont)
1443
1443
body_size_check = php_stream_tell (stream ) - hdr_size ;
1444
1444
php_stream_seek (stream , i , SEEK_SET );
1445
1445
1446
+ if (overflow2 (font -> nchars , font -> h ) || overflow2 (font -> nchars * font -> h , font -> w )) {
1447
+ php_error_docref (NULL , E_WARNING , "Error reading font, invalid font header" );
1448
+ efree (font );
1449
+ php_stream_close (stream );
1450
+ RETURN_FALSE ;
1451
+ }
1452
+
1446
1453
body_size = font -> w * font -> h * font -> nchars ;
1447
1454
if (body_size != body_size_check ) {
1448
1455
font -> w = FLIPWORD (font -> w );
@@ -1451,13 +1458,6 @@ PHP_FUNCTION(imageloadfont)
1451
1458
body_size = font -> w * font -> h * font -> nchars ;
1452
1459
}
1453
1460
1454
- if (overflow2 (font -> nchars , font -> h ) || overflow2 (font -> nchars * font -> h , font -> w )) {
1455
- php_error_docref (NULL , E_WARNING , "Error reading font, invalid font header" );
1456
- efree (font );
1457
- php_stream_close (stream );
1458
- RETURN_FALSE ;
1459
- }
1460
-
1461
1461
if (body_size != body_size_check ) {
1462
1462
php_error_docref (NULL , E_WARNING , "Error reading font" );
1463
1463
efree (font );
You can’t perform that action at this time.
0 commit comments