mirror of
https://github.com/php/php-src.git
synced 2024-09-29 05:46:06 +00:00
709731797c
We must not apply the format correction twice for truecolor images.
22 lines
425 B
PHP
22 lines
425 B
PHP
--TEST--
|
|
Bug #73159 (imagegd2(): unrecognized formats may result in corrupted files)
|
|
--SKIPIF--
|
|
<?php
|
|
if (!extension_loaded('gd')) die('skip gd extension not available');
|
|
?>
|
|
--FILE--
|
|
<?php
|
|
$im = imagecreatetruecolor(10, 10);
|
|
|
|
ob_start();
|
|
imagegd2($im, null, 128, 0);
|
|
$buffer = ob_get_clean();
|
|
|
|
$header = unpack('@12/nformat', $buffer);
|
|
printf("format: %d\n", $header['format']);
|
|
?>
|
|
===DONE===
|
|
--EXPECT--
|
|
format: 4
|
|
===DONE===
|