mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3: Fix #79615: Wrong GIF header written in GD GIFEncode
This commit is contained in:
commit
da801ba5e3
3 changed files with 24 additions and 1 deletions
3
NEWS
3
NEWS
|
@ -12,6 +12,9 @@ PHP NEWS
|
||||||
- FFI:
|
- FFI:
|
||||||
. Fixed bug #79571 (FFI: var_dumping unions may segfault). (cmb)
|
. Fixed bug #79571 (FFI: var_dumping unions may segfault). (cmb)
|
||||||
|
|
||||||
|
- GD:
|
||||||
|
. Fixed bug #79615 (Wrong GIF header written in GD GIFEncode). (sageptr, cmb)
|
||||||
|
|
||||||
- Opcache:
|
- Opcache:
|
||||||
. Fixed bug #79588 (Boolean opcache settings ignore on/off values). (cmb)
|
. Fixed bug #79588 (Boolean opcache settings ignore on/off values). (cmb)
|
||||||
. Fixed bug #79548 (Preloading segfault with inherited method using static
|
. Fixed bug #79548 (Preloading segfault with inherited method using static
|
||||||
|
|
|
@ -333,7 +333,7 @@ GIFEncode(gdIOCtxPtr fp, int GWidth, int GHeight, int GInterlace, int Background
|
||||||
/*
|
/*
|
||||||
* OR in the resolution
|
* OR in the resolution
|
||||||
*/
|
*/
|
||||||
B |= (Resolution - 1) << 5;
|
B |= (Resolution - 1) << 4;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* OR in the Bits per Pixel
|
* OR in the Bits per Pixel
|
||||||
|
|
20
ext/gd/tests/bug79615.phpt
Normal file
20
ext/gd/tests/bug79615.phpt
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
--TEST--
|
||||||
|
Bug #79615 (Wrong GIF header written in GD GIFEncode)
|
||||||
|
--SKIPIF--
|
||||||
|
<?php
|
||||||
|
if (!extension_loaded('gd')) die('skip gd extension not available');
|
||||||
|
?>
|
||||||
|
--FILE--
|
||||||
|
<?php
|
||||||
|
$im = imagecreate(3, 3); // 3x3, 9 colors, 4 bits per pixel
|
||||||
|
for ($x = 0; $x < 3; $x++) {
|
||||||
|
for ($y = 0; $y < 3; $y++) {
|
||||||
|
imagesetpixel($im, $x, $y, imagecolorallocate($im, $x, $y, 0));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ob_start();
|
||||||
|
imagegif($im);
|
||||||
|
echo decbin(ord(ob_get_clean()[0xA]));
|
||||||
|
?>
|
||||||
|
--EXPECT--
|
||||||
|
10110011
|
Loading…
Add table
Add a link
Reference in a new issue