summaryrefslogtreecommitdiff
path: root/ext/gd
diff options
context:
space:
mode:
Diffstat (limited to 'ext/gd')
-rw-r--r--ext/gd/tests/imageloadfont_end_of_file_while_reading_header.phpt10
1 files changed, 10 insertions, 0 deletions
diff --git a/ext/gd/tests/imageloadfont_end_of_file_while_reading_header.phpt b/ext/gd/tests/imageloadfont_end_of_file_while_reading_header.phpt
index 56ff799eb0..ef13bb179d 100644
--- a/ext/gd/tests/imageloadfont_end_of_file_while_reading_header.phpt
+++ b/ext/gd/tests/imageloadfont_end_of_file_while_reading_header.phpt
@@ -10,11 +10,19 @@ if (!extension_loaded('gd')) die("skip gd extension not available\n");
--FILE--
<?php
$filename = dirname(__FILE__) . '/font.gdf';
+
+// End of file while reading header
$bin = "\x41\x41\x41\x41\x00\x00\x00\x00\x00\x00";
$fp = fopen($filename, 'wb');
fwrite($fp, $bin);
fclose($fp);
+$font = imageloadfont($filename);
+// Error while reading header
+$bin = "\xe0\x00\x00\x00\x20\x00\x00\x00\x06\x00\x00\x00\x0a\x00\x00";
+$fp = fopen($filename, 'wb');
+fwrite($fp, $bin);
+fclose($fp);
$font = imageloadfont($filename);
?>
--CLEAN--
@@ -23,3 +31,5 @@ unlink(__DIR__.'/font.gdf');
?>
--EXPECTF--
Warning: imageloadfont(): End of file while reading header in %s on line %d
+
+Warning: imageloadfont(): End of file while reading header in %s on line %d