|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
?? ??? 2019, PHP 7.2.15
+- GD:
+ . Fixed bug #77391 (1bpp BMPs may fail to be loaded). (Romain Déoux, cmb)
+
- Sockets:
. Fixed bug #76839 (socket_recvfrom may return an invalid 'from' address
on MacOS). (Michael Meyer)
}
}
- /* The line must be divisible by 4, else its padded with NULLs */
- padding = ((int)ceil(0.1 * info->width)) % 4;
+ /* The line must be aligned on a 32 bits word, else it is padded with zeros */
+ padding = (info->width + 7) / 8 % 4;
if (padding) {
padding = 4 - padding;
}
--- /dev/null
+--TEST--
+Bug #77391 (1bpp BMPs may fail to be loaded)
+--SKIPIF--
+<?php
+if (!extension_loaded('gd')) die('skip gd extension not available');
+if (!GD_BUNDLED && version_compare(GD_VERSION, '2.2.5', '<=')) die('skip upstream not yet fixed');
+?>
+--FILE--
+<?php
+var_dump(imagecreatefrombmp(__DIR__ . '/bug77391.bmp'));
+?>
+===DONE===
+--EXPECTF--
+resource(%d) of type (gd)
+===DONE===