Commit graph

595 commits

Author SHA1 Message Date
Christoph M. Becker
c8c8c0b52c Merge branch 'PHP-7.1' 2016-10-25 14:41:00 +02:00
Christoph M. Becker
af4bfe234c Merge branch 'PHP-5.6' into PHP-7.0 2016-10-25 14:31:41 +02:00
Christoph M. Becker
cd13d0260a Fix #72494: imagecropauto out-of-bounds access
This issue has actually already been fixed with commit 46f2c690. We're
adding a regression test and a NEWS entry, and also port the fix in
gdImageCropThreshold() from libgd:
  * <b347e034>
  * <46f2c690>
2016-10-25 14:29:48 +02:00
Christoph M. Becker
0f49aa3287 Merge branch 'pull-request/2151' 2016-10-17 10:37:38 +02:00
Anatol Belski
19605950fc add missing header for gd_error 2016-10-13 14:40:37 +02:00
Anatol Belski
fa45124138 fix syslog interference 2016-10-13 14:40:37 +02:00
Christoph M. Becker
a9209588d5 Merge branch 'PHP-7.0' into PHP-7.1 2016-10-13 11:31:37 +02:00
Christoph M. Becker
b8fab503fe Merge branch 'PHP-5.6' into PHP-7.0 2016-10-13 11:25:11 +02:00
Christoph M. Becker
cc08cbc84d Fix #73280: Stack Buffer Overflow in GD dynamicGetbuf
We make sure to never pass a negative `rlen` as size to memcpy().

Cf. <53110871>.
2016-10-13 11:10:02 +02:00
Christoph M. Becker
4be36b536e Merge branch 'PHP-7.1' 2016-10-10 12:13:07 +02:00
Christoph M. Becker
fb08216b08 Merge branch 'PHP-5.6' into PHP-7.0 2016-10-10 11:45:53 +02:00
Christoph M. Becker
fc989fc6e7 Fix #73279: Integer overflow in gdImageScaleBilinearPalette()
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 <77c8d359>.
2016-10-10 11:41:39 +02:00
Christoph M. Becker
432e16cb58 Unify error handling of bundled and external libgd
There's no need anymore to call an own error handler directly. Instead we
register our error handler and call libgd's error functions (which will
forward). We do this regardless of compiling with the bundled or an external
libgd.
2016-10-07 01:13:49 +02:00
Christoph M. Becker
2b134a1dcb Move freeing of truecolor pixels to a function
We port <81675d39>.
2016-10-03 12:11:46 +02:00
Christoph M. Becker
ec591b555f Change gdImageTrueColorToPalette() to return success/failure
We're porting the relevant changes from
<34a00a40>.

We also check the return value in the PHP binding, and throw E_WARNING if
the conversion failed.
2016-10-03 12:02:31 +02:00
Christoph M. Becker
2a305b38b7 Implement request #33066: Add GD Image Function gdImageOpenPolygon()
gdImageOpenPolygon() has been introduced with líbgd 2.0.29, so we finally
add a PHP binding for it, and port the respective libgd functionality to
PHP's bundled libgd.
2016-10-02 20:27:58 +02:00
Christoph M. Becker
82a8e57f37 Add support for gdEffectMultiply
gdLayerMultiply() has been introduced in libgd 2.1.1, and as such would have
been already available for imagelayereffect() with a system libgd. We port
the respective code to the bundled libgd, and also make IMG_EFFECT_MULTIPLY
available to userland.
2016-10-02 19:10:13 +02:00
Christoph M. Becker
d0f14a4429 Switch to libgd anti-aliased drawing API
Instead of rolling our own in the bundled libgd, we use libgd's anti-aliased
drawing API. This way imageantialias() is also available, when built against
a system libgd.
2016-10-02 13:16:40 +02:00
Christoph M. Becker
0e38932d14 Merge branch 'PHP-7.1' 2016-10-01 00:02:05 +02:00
Christoph M. Becker
12967bc346 Merge branch 'PHP-5.6' into PHP-7.0 2016-09-30 23:54:18 +02:00
Christoph M. Becker
9acfb1a3a5 Fix #73213: Integer overflow in imageline() with antialiasing
We port the respective fixes <eca37d620>
and <837b7327> to our bundled libgd.
2016-09-30 23:38:13 +02:00
Christoph M. Becker
c60cdac636 Fix overflow checks
We check for the proper sizeofs, cf.
<c3cf674c>.
2016-09-30 20:15:15 +02:00
Christoph M. Becker
e3b889700b Remove further remains of the old antialiasing support
Curiously, while the external GD claims "just a few vestiges after switching
to the fast, memory-cheap implementation from PHP-gd", that stuff was still
in the bundled GD.
2016-09-30 17:04:37 +02:00
Christoph M. Becker
04400b19fc Remove basically effectless gdImageAABlend()
This had already be done for GD 2.0.26 as part of the improved antialiasing
support (<https://boutell.com/gd/manual2.0.26.html#whatsnew2.0.26>).
2016-09-30 16:12:47 +02:00
Christoph M. Becker
68b1d4c299 Merge branch 'PHP-7.1' 2016-09-24 12:52:14 +02:00
Christoph M. Becker
5c81298597 Merge branch 'PHP-5.6' into PHP-7.0 2016-09-24 12:41:48 +02:00
Christoph M. Becker
8f5eda4bf6 Fix #73161: imagecreatefromgd2() may leak memory 2016-09-24 12:36:54 +02:00
Christoph M. Becker
9e7ccba7c9 Merge branch 'PHP-7.1' 2016-09-24 11:42:55 +02:00
Christoph M. Becker
61722743f4 Merge branch 'PHP-5.6' into PHP-7.0 2016-09-24 11:31:54 +02:00
Christoph M. Becker
709731797c Fix #73159: imagegd2(): unrecognized formats may result in corrupted files
We must not apply the format correction twice for truecolor images.
2016-09-24 11:28:20 +02:00
Christoph M. Becker
cf5c2acbb4 Merge branch 'PHP-7.1' 2016-09-24 11:03:46 +02:00
Christoph M. Becker
0a4b72fa94 Merge branch 'PHP-5.6' into PHP-7.0 2016-09-24 10:48:24 +02:00
Christoph M. Becker
c7936ead8f Fix #73155: imagegd2() writes wrong chunk sizes on boundaries 2016-09-24 10:33:49 +02:00
Christoph M. Becker
dc59aafa77 Merge branch 'PHP-7.1' 2016-09-20 01:38:28 +02:00
Christoph M. Becker
ba2d9e1ff1 Merge branch 'PHP-5.6' into PHP-7.0 2016-09-20 01:25:08 +02:00
Christoph M. Becker
fc2cadca2d Merge branch 'pull-request/1845' into PHP-5.6 2016-09-20 01:05:57 +02:00
Christoph M. Becker
be30c34fb8 Sync with libgd wrt. compilation units
* integrate gd_arc.c into gd.c (as of gd-2.1.0-alpha1)
 * rename gd_color.c to gd_color_match.c (as of gd-2.1.0-alpha1)
 * remove mathmake.c (as of GD_2_0_34RC1)
 * rename xbm.c to gd_xbm.c (as of gd-2.1.0-alpha1)
2016-09-20 00:34:19 +02:00
Christoph M. Becker
a14c220fd9 Remove unused compilation unit
gd_arc_f_buggy.c has already been removed in GD 2.0.34RC, so we're also
getting rid of the file.
2016-09-19 23:48:23 +02:00
Christoph M. Becker
932c20fb8d Port variable image resolution support from libgd 2.1.0
The PHP binding for this feature will be submitted as a separate PR.
2016-09-19 19:00:58 +02:00
Christoph M. Becker
77ba2483d9 Port gdImageSetStyle() overflow check from libgd 2.0.29 2016-09-19 16:56:07 +02:00
Christoph M. Becker
3c2de0a534 Merge branch 'PHP-7.1' 2016-09-16 11:54:18 +02:00
Christoph M. Becker
c18263e0e0 Merge branch 'PHP-5.6' into PHP-7.0 2016-09-16 11:41:42 +02:00
Christoph M. Becker
46df064261 Fix #73003: Integer Overflow in gdImageWebpCtx of gd_webp.c
We add the missing integer overflow check to avoid potential buffer overflows.
2016-09-16 11:37:18 +02:00
Christoph M. Becker
ba2b50d097 Port optimization from external libgd
The functionality is identical, but we save two function calls for partially
transparent pixels.
2016-09-15 13:24:43 +02:00
Christoph M. Becker
04b166a6c5 Removed unused function
The earlier gdAlphaBlend() has been replaced with commit 1286d9e2, and has
been renamed to gdAlphaBlendOld(). The old function is, however, not used,
and after more than 9 years we're pretty sure we won't need it anymore.
2016-09-15 13:04:30 +02:00
Christoph M. Becker
dbdc7cb057 Remove unnecessary #ifdef
The bundled libgd also defines gdImageAlphaBlending(), and this is the
preferred way to set the alphaBlendingFlag member anyway.
2016-09-14 23:38:02 +02:00
Christoph M. Becker
f81f40fbd3 Remove unused code which is also not there in external libgd 2016-09-14 17:01:41 +02:00
Christoph M. Becker
aad54b7c5f Merge branch 'PHP-7.1' 2016-09-14 16:11:04 +02:00
Christoph M. Becker
bc27ce98ee Merge branch 'PHP-5.6' into PHP-7.0 2016-09-14 15:50:09 +02:00
Christoph M. Becker
09eb6ed35e Fix #50194: imagettftext broken on transparent background w/o alphablending
We must not draw the background pixels of the character glyphs, what has
already been fixed in GD 2.0.26.
2016-09-14 15:47:32 +02:00