php-src/ext/gd
Christoph M. Becker 2d1c3825a8
Simplify WBMP imagecreatefromstring() detection (GH-16782)
According to the WBMP specification[1], the first field (type) of a
WBMP is a multi-byte integer, but only type `0` is supported.  Thus
there is no need to read a multi-byte integer.  The second field (fix
header) is a single byte; reading a multi-byte integer is not really
wrong, since the fix header field is laid out in a way which allows it
to be treated as such, but the check whether the MBI is greater than
or equal to zero is pretty useless, because negative values could only
be returned if overflow occurs (MBIs are unsigned).

So the only useful assumption we can make is that the first byte is
zero; we let `gdImageCreateFromWBMPCtx()` figure out the rest.

[1] <https://www.wapforum.org/what/technical/SPEC-WAESpec-19990524.pdf> section 6
2024-11-14 14:00:19 +01:00
..
libgd Merge branch 'PHP-8.3' into PHP-8.4 2024-10-23 20:10:04 +02:00
tests Simplify WBMP imagecreatefromstring() detection (GH-16782) 2024-11-14 14:00:19 +01:00
config.m4 Autotools: Refactor PHP_TEST_BUILD checks (#15798) 2024-09-08 21:05:30 +02:00
config.w32 Support building ext/gd without libxpm on Windows (GH-15846) 2024-09-12 12:29:18 +02:00
CREDITS Convert GD Resources to objects 2019-09-30 15:14:02 +02:00
gd_arginfo.h Generated arginfo header files: combine preprocessor conditional blocks (#15736) 2024-09-04 13:04:22 +02:00
gd_compat.c Preferably include from build dir (#13516) 2024-06-26 00:26:43 +02:00
gd_compat.h cleanup gd build with system libgd - drop need to use libpng with system libgd - drop need to use libjpeg with system libgd - drop need to use libXpm with system libgd - drop need to use libfreetype with system libgd - improve configure comments 2019-07-22 16:14:19 +02:00
gd.c Simplify WBMP imagecreatefromstring() detection (GH-16782) 2024-11-14 14:00:19 +01:00
gd.stub.php ext/gd: imagerotate removes ignore_transparent argument. 2023-06-19 12:32:08 +01:00
php_gd.h Declare ext/gd constants in stubs (#9180) 2022-07-30 15:18:06 +02:00