xref: /PHP-5.6/ext/gd/tests/bug73159.phpt (revision 70973179)
1--TEST--
2Bug #73159 (imagegd2(): unrecognized formats may result in corrupted files)
3--SKIPIF--
4<?php
5if (!extension_loaded('gd')) die('skip gd extension not available');
6?>
7--FILE--
8<?php
9$im = imagecreatetruecolor(10, 10);
10
11ob_start();
12imagegd2($im, null, 128, 0);
13$buffer = ob_get_clean();
14
15$header = unpack('@12/nformat', $buffer);
16printf("format: %d\n", $header['format']);
17?>
18===DONE===
19--EXPECT--
20format: 4
21===DONE===
22