1--TEST--
2imageloadfont() "End of file while reading header"
3--CREDITS--
4Ike Devolder <ike.devolder@gmail.com>
5User Group: PHP-WVL & PHPGent #PHPTestFest
6--SKIPIF--
7<?php
8if (!extension_loaded('gd')) die("skip gd extension not available\n");
9?>
10--FILE--
11<?php
12$filename = __DIR__ .  '/font.gdf';
13
14// End of file while reading header
15$bin = "\x41\x41\x41\x41\x00\x00\x00\x00\x00\x00";
16$fp = fopen($filename, 'wb');
17fwrite($fp, $bin);
18fclose($fp);
19$font = imageloadfont($filename);
20
21// Error while reading header
22$bin = "\xe0\x00\x00\x00\x20\x00\x00\x00\x06\x00\x00\x00\x0a\x00\x00";
23$fp = fopen($filename, 'wb');
24fwrite($fp, $bin);
25fclose($fp);
26$font = imageloadfont($filename);
27?>
28--CLEAN--
29<?php
30unlink(__DIR__.'/font.gdf');
31?>
32--EXPECTF--
33Warning: imageloadfont(): End of file while reading header in %s on line %d
34
35Warning: imageloadfont(): End of file while reading header in %s on line %d
36