mirror of
https://github.com/php/php-src.git
synced 2024-09-29 05:46:06 +00:00
fc989fc6e7
The color components are supposed to be in range 0..255, so we must not cast them to `signed char`, what can be the default for `char`. Port of <https://github.com/libgd/libgd/commit/77c8d359>.
23 lines
582 B
PHP
23 lines
582 B
PHP
--TEST--
|
|
Bug #73279 (Integer overflow in gdImageScaleBilinearPalette())
|
|
--SKIPIF--
|
|
<?php
|
|
if (!extension_loaded('gd')) die('skip gd extension not available');
|
|
if (GD_BUNDLED || version_compare(GD_VERSION, '2.2.4', '>=')) {
|
|
die('skip only for external libgd < 2.2.4');
|
|
}
|
|
?>
|
|
--FILE--
|
|
<?php
|
|
$src = imagecreate(100, 100);
|
|
imagecolorallocate($src, 255, 255, 255);
|
|
$dst = imagescale($src, 200, 200, IMG_BILINEAR_FIXED);
|
|
printf("color: %x\n", imagecolorat($dst, 99, 99));
|
|
?>
|
|
===DONE===
|
|
--XFAIL--
|
|
Bug #330 has not yet been fixed
|
|
--EXPECT--
|
|
color: ffffff
|
|
===DONE===
|