mirror of
https://github.com/php/php-src.git
synced 2026-04-24 00:18:23 +02:00
Merge branch 'PHP-5.6'
* PHP-5.6: updated NEWS Fix #69024: imagescale segfault with palette based image
This commit is contained in:
@@ -1059,6 +1059,11 @@ gdImagePtr gdImageScaleTwoPass(const gdImagePtr src, const unsigned int src_widt
|
||||
gdImagePtr tmp_im;
|
||||
gdImagePtr dst;
|
||||
|
||||
/* Convert to truecolor if it isn't; this code requires it. */
|
||||
if (!src->trueColor) {
|
||||
gdImagePaletteToTrueColor(src);
|
||||
}
|
||||
|
||||
tmp_im = gdImageCreateTrueColor(new_width, src_height);
|
||||
if (tmp_im == NULL) {
|
||||
return NULL;
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
--TEST--
|
||||
Bug #69024 (imagescale segfault with palette based image)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('gd')) die('skip gd extension not available');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
$im = imagecreate(256, 256);
|
||||
imagescale($im, 32, 32, IMG_BICUBIC);
|
||||
imagedestroy($im);
|
||||
echo "done\n";
|
||||
?>
|
||||
--EXPECT--
|
||||
done
|
||||
Reference in New Issue
Block a user