Commit Graph

575 Commits

Author SHA1 Message Date
Pierre Joye
b25009fc2c #72482, Ilegal write/read access caused by gdImageAALine overflow 2016-07-19 19:34:07 +07:00
Pierre Joye
1e9273c48b Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  improve fix #72558, free contribRow as well
2016-07-19 16:33:38 +07:00
Pierre Joye
48e76abadd improve fix #72558, free contribRow as well 2016-07-19 16:33:17 +07:00
Pierre Joye
bc8c722cb4 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  improve fix #72558, while (u>=0) with unsigned int will always be true
2016-07-19 15:53:25 +07:00
Pierre Joye
df09515089 improve fix #72558, while (u>=0) with unsigned int will always be true 2016-07-19 15:51:43 +07:00
Stanislav Malyshev
9698082306 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Fix memory leak
2016-07-19 01:47:48 -07:00
Stanislav Malyshev
f69362d212 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Fix memory leak
2016-07-19 01:47:40 -07:00
Stanislav Malyshev
47d6ea6332 Fix memory leak 2016-07-19 01:47:27 -07:00
Stanislav Malyshev
b00f8f2a5b Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  fix #72519, possible OOB using imagegif
  fix #72512, invalid read or write for palette image when invalid transparent index is used
  Apparently some envs miss SIZE_MAX
  Fix tests
  Fix bug #72618: NULL Pointer Dereference in exif_process_user_comment
  Partial fix for bug #72613 - do not treat negative returns from bz2 as size_t
  Fix bug #72606: heap-buffer-overflow (write) simplestring_addn simplestring.c
  Fix for bug #72558, Integer overflow error within _gdContributionsAlloc()
  Fix bug #72603: Out of bound read in exif_process_IFD_in_MAKERNOTE
  Fix bug #72562 - destroy var_hash properly
  Fix bug #72533 (locale_accept_from_http out-of-bounds access)
  Fix fir bug #72520
  Fix for bug #72513
  Fix for bug #72513
  CS fix and comments with bug ID
  Fix for HTTP_PROXY issue.
  5.6.24RC1
  add tests for bug #72512
  Fixed bug #72512 gdImageTrueColorToPaletteBody allows arbitrary write/read access
  Fixed bug #72479 - same as #72434

Conflicts:
	Zend/zend_virtual_cwd.c
	ext/bz2/bz2.c
	ext/exif/exif.c
	ext/session/session.c
	ext/snmp/snmp.c
	ext/standard/basic_functions.c
	main/SAPI.c
	main/php_variables.c
2016-07-19 01:39:28 -07:00
Stanislav Malyshev
4d0565b5ba Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  fix #72519, possible OOB using imagegif
  fix #72512, invalid read or write for palette image when invalid transparent index is used
  Apparently some envs miss SIZE_MAX
  Fix tests
  Fix bug #72618: NULL Pointer Dereference in exif_process_user_comment
  Partial fix for bug #72613 - do not treat negative returns from bz2 as size_t
  Fix bug #72606: heap-buffer-overflow (write) simplestring_addn simplestring.c
  Fix for bug #72558, Integer overflow error within _gdContributionsAlloc()
  Fix bug #72603: Out of bound read in exif_process_IFD_in_MAKERNOTE
  Fix bug #72562 - destroy var_hash properly
  Fix bug #72533 (locale_accept_from_http out-of-bounds access)
  Fix fir bug #72520
  Fix for bug #72513
  CS fix and comments with bug ID
  Fix for HTTP_PROXY issue.
  add tests for bug #72512
  Fixed bug #72512 gdImageTrueColorToPaletteBody allows arbitrary write/read access
  Fixed bug #72479 - same as #72434

Conflicts:
	ext/bz2/bz2.c
	main/SAPI.c
	main/php_variables.c
2016-07-19 00:53:08 -07:00
Pierre Joye
8dc5ffa479 fix #72519, possible OOB using imagegif 2016-07-19 00:37:53 -07:00
Pierre Joye
928aecc002 fix #72512, invalid read or write for palette image when invalid transparent index is used
Conflicts:
	ext/gd/libgd/gd.c
2016-07-19 00:37:38 -07:00
Pierre Joye
05e8a0febe Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  fix #72519, possible OOB using imagegif
2016-07-19 14:16:20 +07:00
Pierre Joye
b61bd1243a Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  fix #72519, possible OOB using imagegif
2016-07-19 14:16:01 +07:00
Pierre Joye
2fbce5f51f fix #72519, possible OOB using imagegif 2016-07-19 14:11:44 +07:00
Pierre Joye
740661bd7a Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  fix #72512, invalid read or write for palette image when invalid transparent index is used
2016-07-19 13:40:34 +07:00
Pierre Joye
511f07b747 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  fix #72512, invalid read or write for palette image when invalid transparent index is used
2016-07-19 13:39:46 +07:00
Pierre Joye
0fbcff1b35 fix #72512, invalid read or write for palette image when invalid transparent index is used 2016-07-19 13:37:23 +07:00
Stanislav Malyshev
d1a491acf3 Fix for bug #72558, Integer overflow error within _gdContributionsAlloc() 2016-07-18 00:17:48 -07:00
Christoph M. Becker
190fbb94e7 Merge branch 'PHP-5.6' into PHP-7.0 2016-07-15 20:02:44 +02:00
Christoph M. Becker
3666cfab97 Fix #72604: imagearc() ignores thickness for full arcs
We remove the special casing for full arcs, what conforms to external libgd.
2016-07-15 19:45:52 +02:00
Pierre Joye
7b2c22696a Fixed bug #72512 gdImageTrueColorToPaletteBody allows arbitrary write/read access 2016-07-04 10:35:20 +02:00
Stanislav Malyshev
8705254f2d Merge branch 'PHP-7.0.8' into PHP-7.0
* PHP-7.0.8:
  iFixed bug #72446 - Integer Overflow in gdImagePaletteToTrueColor() resulting in heap overflow
  update NEWS
  fix tests
  fix build
  Fix bug #72455:  Heap Overflow due to integer overflows
  Fix bug #72434: ZipArchive class Use After Free Vulnerability in PHP's GC algorithm and unserialize
  Fixed ##72433: Use After Free Vulnerability in PHP's GC algorithm and unserialize
  Fix bug #72407: NULL Pointer Dereference at _gdScaleVert
  Fix bug #72402: _php_mb_regex_ereg_replace_exec - double free
  Fix bug #72298	pass2_no_dither out-of-bounds access
  Fixed #72339 Integer Overflow in _gd2GetHeader() resulting in heap overflow
  Fix bug #72262 - do not overflow int
  Fix bug #72400 and #72403 - prevent signed int overflows for string lengths
  Fix bug #72275: don't allow smart_str to overflow int
  Fix bug #72340: Double Free Courruption in wddx_deserialize
  Fix bug #72321 - use efree() for emalloc allocation
  5.6.23RC1
  fix NEWS
  set versions

Conflicts:
	configure.in
	main/php_version.h
2016-06-21 00:25:49 -07:00
Stanislav Malyshev
2a65544f78 Merge branch 'PHP-5.6.23' into PHP-7.0.8
* PHP-5.6.23: (24 commits)
  iFixed bug #72446 - Integer Overflow in gdImagePaletteToTrueColor() resulting in heap overflow
  update NEWS
  fix tests
  fix build
  Fix bug #72455:  Heap Overflow due to integer overflows
  Fix bug #72434: ZipArchive class Use After Free Vulnerability in PHP's GC algorithm and unserialize
  Fixed ##72433: Use After Free Vulnerability in PHP's GC algorithm and unserialize
  Fix bug #72407: NULL Pointer Dereference at _gdScaleVert
  Fix bug #72402: _php_mb_regex_ereg_replace_exec - double free
  Fix bug #72298	pass2_no_dither out-of-bounds access
  Fixed #72339 Integer Overflow in _gd2GetHeader() resulting in heap overflow
  Fix bug #72262 - do not overflow int
  Fix bug #72400 and #72403 - prevent signed int overflows for string lengths
  Fix bug #72275: don't allow smart_str to overflow int
  Fix bug #72340: Double Free Courruption in wddx_deserialize
  update NEWS
  Fix #66387: Stack overflow with imagefilltoborder
  Fix bug #72321 - use efree() for emalloc allocation
  5.6.23RC1
  Fix bug #72140 (segfault after calling ERR_free_strings())
  ...

Conflicts:
	configure.in
	ext/mbstring/php_mbregex.c
	ext/mcrypt/mcrypt.c
	ext/spl/spl_array.c
	ext/spl/spl_directory.c
	ext/standard/php_smart_str.h
	ext/standard/string.c
	ext/standard/url.c
	ext/wddx/wddx.c
	ext/zip/php_zip.c
	main/php_version.h
2016-06-21 00:24:32 -07:00
Stanislav Malyshev
c9b24ef307 Merge branch 'PHP-5.6.23' into PHP-5.6
* PHP-5.6.23:
  Fixed bug #72446 - Integer Overflow in gdImagePaletteToTrueColor() resulting in heap overflow
  update NEWS
  fix tests
  fix build
  Fix bug #72455:  Heap Overflow due to integer overflows
  Fix bug #72434: ZipArchive class Use After Free Vulnerability in PHP's GC algorithm and unserialize
  Fixed ##72433: Use After Free Vulnerability in PHP's GC algorithm and unserialize
  Fix bug #72407: NULL Pointer Dereference at _gdScaleVert
  Fix bug #72402: _php_mb_regex_ereg_replace_exec - double free
  Fix bug #72298	pass2_no_dither out-of-bounds access
  Fixed #72339 Integer Overflow in _gd2GetHeader() resulting in heap overflow
  Fix bug #72262 - do not overflow int
  Fix bug #72400 and #72403 - prevent signed int overflows for string lengths
  Fix bug #72275: don't allow smart_str to overflow int
  Fix bug #72340: Double Free Courruption in wddx_deserialize
  Fix bug #72321 - use efree() for emalloc allocation
  5.6.23RC1

Conflicts:
	configure.in
	main/php_version.h
2016-06-21 00:02:37 -07:00
Stanislav Malyshev
7dde353ee7 Merge branch 'PHP-5.5' into PHP-5.6.23
* PHP-5.5:
  Fixed bug #72446 - Integer Overflow in gdImagePaletteToTrueColor() resulting in heap overflow
  update NEWS
  fix tests
  fix build
  Fix bug #72455:  Heap Overflow due to integer overflows
  Fix bug #72434: ZipArchive class Use After Free Vulnerability in PHP's GC algorithm and unserialize
  Fixed ##72433: Use After Free Vulnerability in PHP's GC algorithm and unserialize
  Fix bug #72407: NULL Pointer Dereference at _gdScaleVert
  Fix bug #72402: _php_mb_regex_ereg_replace_exec - double free
  Fix bug #72298	pass2_no_dither out-of-bounds access
  Fixed #72339 Integer Overflow in _gd2GetHeader() resulting in heap overflow
  Fix bug #72262 - do not overflow int
  Fix bug #72400 and #72403 - prevent signed int overflows for string lengths
  Fix bug #72275: don't allow smart_str to overflow int
  Fix bug #72340: Double Free Courruption in wddx_deserialize
  update NEWS
  Fix #66387: Stack overflow with imagefilltoborder
  Skip test which is 64bits only
  5.5.37 now

Conflicts:
	configure.in
	ext/mcrypt/mcrypt.c
	ext/spl/spl_directory.c
	main/php_version.h
2016-06-21 00:01:48 -07:00
Stanislav Malyshev
c395c6e5d7 iFixed bug #72446 - Integer Overflow in gdImagePaletteToTrueColor() resulting in heap overflow 2016-06-20 23:58:26 -07:00
Stanislav Malyshev
e1d2f86a41 Merge branch 'PHP-5.5.37' into PHP-5.5
* PHP-5.5.37:
  fix tests
  fix build
  Fix bug #72455:  Heap Overflow due to integer overflows
  Fix bug #72434: ZipArchive class Use After Free Vulnerability in PHP's GC algorithm and unserialize
  Fixed ##72433: Use After Free Vulnerability in PHP's GC algorithm and unserialize
  Fix bug #72407: NULL Pointer Dereference at _gdScaleVert
  Fix bug #72402: _php_mb_regex_ereg_replace_exec - double free
  Fix bug #72298	pass2_no_dither out-of-bounds access
  Fixed #72339 Integer Overflow in _gd2GetHeader() resulting in heap overflow
  Fix bug #72262 - do not overflow int
  Fix bug #72400 and #72403 - prevent signed int overflows for string lengths
  Fix bug #72275: don't allow smart_str to overflow int
  Fix bug #72340: Double Free Courruption in wddx_deserialize
2016-06-20 23:31:54 -07:00
Stanislav Malyshev
5f107ab8a6 fix tests 2016-06-20 22:54:55 -07:00
Christoph M. Becker
5cc924e5c2 Merge branch 'PHP-5.6' into PHP-7.0 2016-06-20 15:20:58 +02:00
Christoph M. Becker
4b4275059f Fix #64641: imagefilledpolygon doesn't draw horizontal line
As has been reported, 1-dimensional horizontal filled polygons are not drawn
at all. That is caused by the scanline algorithm used for drawing filled
polygons which skips the drawing of horizontal edges, because that is
normally not necessary. If, however, the polygon consists of horizontal
edges only, that obviously doesn't work, so we add a special case handling.

That has also been fixed in libgd with
<https://github.com/libgd/libgd/commit/f9f10fa9>.
2016-06-20 15:17:52 +02:00
Stanislav Malyshev
b9ec171e7d Fix bug #72407: NULL Pointer Dereference at _gdScaleVert 2016-06-18 21:57:25 -07:00
Stanislav Malyshev
e9ac8954be Fix bug #72298 pass2_no_dither out-of-bounds access 2016-06-18 21:06:09 -07:00
Pierre Joye
7722455726 Fixed #72339 Integer Overflow in _gd2GetHeader() resulting in heap overflow 2016-06-18 20:15:10 +02:00
Christoph M. Becker
eb456d2d27 Merge branch 'PHP-5.6' into PHP-7.0 2016-06-17 17:52:10 +02:00
Christoph M. Becker
ed0ec66996 Fix #53640: XBM images require width to be multiple of 8 2016-06-17 17:50:36 +02:00
Christoph M. Becker
60feda4ea4 Merge branch 'PHP-5.6' into PHP-7.0 2016-06-16 14:06:39 +02:00
Christoph M. Becker
8aa511f1fc Fix #43475: Styled thick horizontal lines are scrambled
Thick lines are drawn by gdImageFilledRectangle(), which iterates over
the x ordinate first (Z order) to apply the style pattern. While this works
fine for vertical and diagonal lines, it obviously fails for horizontal
lines, which have to be iterated over in N order.

To fix this bug, we introduce the helpers  gdImageFilled(H|V)Rectangle(),
which may be reused for other purposes as well.

This is basically the same fix as libgd/libgd/c2b91dbc.
2016-06-16 13:59:00 +02:00
Christoph M. Becker
f96ebb0986 Fix #66387: Stack overflow with imagefilltoborder
The stack overflow is caused by the recursive algorithm in combination with a
very large negative coordinate passed to gdImageFillToBorder(). As there is
already a clipping for large positive coordinates to the width and height of
the image, it seems to be consequent to clip to zero also.
2016-06-13 08:10:36 +02:00
Pierre Joye
4d81bf937f Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  prevent invalid color index (palette only), may lead to crash
  Add CVE to #66387
  add missing NEWS entry
2016-06-08 11:07:32 +07:00
Pierre Joye
6d3fa654b7 prevent invalid color index (palette only), may lead to crash 2016-06-08 11:06:48 +07:00
Pierre Joye
1bbd7fc7eb Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  #72337 invalid dimensions can lead to segv
2016-06-07 17:18:14 +07:00
Pierre Joye
f80125950c #72337 invalid dimensions can lead to segv 2016-06-07 17:16:40 +07:00
Stanislav Malyshev
3ed0114e7f Merge branch 'PHP-5.5' into PHP-7.0.7
* PHP-5.5:
  Fix memory leak in imagescale()
  Update NEWS
  Better fix for bug #72135
  Fixed bug #72227: imagescale out-of-bounds read
  Fix bug #72241: get_icu_value_internal out-of-bounds read
  Fix bug #72135 - don't create strings with lengths outside int range
  Add check for string overflow to all string add operations
  Fix bug #72114 - int/size_t confusion in fread
  Updated NEWS
  Fixed bug #71331 - Uninitialized pointer in phar_make_dirstream()

Conflicts:
	Zend/zend_operators.c
	ext/intl/locale/locale_methods.c
	ext/phar/dirstream.c
	ext/phar/tests/bug71331.phpt
	ext/standard/file.c
	ext/standard/html.c
2016-05-24 18:05:06 -07:00
Stanislav Malyshev
544940c48a Merge branch 'PHP-5.5' into PHP-5.6.22
* PHP-5.5:
  Fix memory leak in imagescale()
  Update NEWS
  Better fix for bug #72135
  Fixed bug #72227: imagescale out-of-bounds read
  Fix bug #72241: get_icu_value_internal out-of-bounds read
  Fix bug #72135 - don't create strings with lengths outside int range
  Add check for string overflow to all string add operations
  Fix bug #72114 - int/size_t confusion in fread
  Updated NEWS
  Fixed bug #71331 - Uninitialized pointer in phar_make_dirstream()

Conflicts:
	Zend/zend_operators.c
	ext/phar/dirstream.c
	ext/phar/tests/bug71331.phpt
2016-05-24 16:56:36 -07:00
Stanislav Malyshev
9a826a3bd9 Fix memory leak in imagescale() 2016-05-24 16:12:01 -07:00
Stanislav Malyshev
7a1aac3343 Fixed bug #72227: imagescale out-of-bounds read
Ported from 4f65a3e4ee
2016-05-23 00:34:35 -07:00
Anatol Belski
33d41da347 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Fix memory leak
  Fix bug #72099: xml_parse_into_struct segmentation fault
  5.5.36 now
  Fix bug #72094 - Out of bounds heap read access in exif header processing
  Fix bug #72093: bcpowmod accepts negative scale and corrupts _one_ definition
  Fix bug #72061 - Out-of-bounds reads in zif_grapheme_stripos with negative offset
  Fix for bug #71912 (libgd: signedness vulnerability)
  Typo in NEWS
2016-04-27 11:45:29 +02:00
Stanislav Malyshev
e315a162da Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Fix memory leak
  Fix bug #72099: xml_parse_into_struct segmentation fault
  5.5.36 now
  Fix bug #72094 - Out of bounds heap read access in exif header processing
  Fix bug #72093: bcpowmod accepts negative scale and corrupts _one_ definition
  Fix bug #72061 - Out-of-bounds reads in zif_grapheme_stripos with negative offset
  Fix for bug #71912 (libgd: signedness vulnerability)
  Typo in NEWS

Conflicts:
	configure.in
	main/php_version.h
2016-04-26 23:48:41 -07:00
Stanislav Malyshev
61c7a06e7c Fix memory leak 2016-04-26 22:54:58 -07:00
Stanislav Malyshev
b15f0ecc0f Fix for bug #71912 (libgd: signedness vulnerability) 2016-04-18 22:24:16 -07:00
Mark Plomer
f5f94d9c08 fix left-shifted/misaligned bounding-box + wrong kerning in imagettfbbox/imageftbbox
- load glyph with FT_LOAD_IGNORE_TRANSFORM for bbox as final bbox is rotated at once later (fixes "double-rotation" per glyph for calculating bbox)
- reload the rotated glyph for painting after that (only if angle != 0)
- rotate the original bbox at 0,0 and do not throw away xMin/yMin (drawing-rotation is also based at "origin" point - including the bearingX, see http://www.freetype.org/freetype2/docs/glyphs/glyphs-3.html#section-3) - this fixes the "left-shift"-problem also when angle = 0
- removed "xb/yb" and use "x/y" directly for offsetting brect (no need for adding "x1/y1" and substracting "yd" later)
- removed therefore unused "yd" helper var which seems tried to fix parts of the original problems
- initialize x/y with 0 instead of -1 in php_imagettftext_common() to make image*text() and image*bbox() results identical (there was a -1px shift in image*bbox() before)
- fixed gdroundupdown() for negative numbers (-256 / 64 gives -5 instead of -4 before)
- rotate kerning-delta by given angle (fixes completely wrong kerning and therefore wrong bounding box if angle != 0)
- changed 3 tests and added a new one to test for the new (better) coordinates
2016-04-03 12:11:26 +02:00
Paul Tarjan
9f25f736ed Dont ignore errors from FT_Get_Glyph 2016-04-03 12:11:25 +02:00
Anatol Belski
f7e81fd9f1 fix double free and move temps into local scope 2016-03-07 16:38:47 +01:00
Anatol Belski
0fccddba75 add error check 2016-03-07 16:26:01 +01:00
Remi Collet
aa8d3a8cc6 fix the fix for bug #70976 (imagerotate) 2016-01-12 14:03:35 +01:00
Remi Collet
af3f3be0c1 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  fix the fix for bug #70976 (imagerotate)
  Use php_session_abort()
2016-01-12 13:54:23 +01:00
Remi Collet
14e4d393cf fix the fix for bug #70976 (imagerotate) 2016-01-12 13:52:27 +01:00
Stanislav Malyshev
13750cb0a1 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Update NEWS
  Improve fix for bug #70976
  Fixed bug #70661 (Use After Free Vulnerability in WDDX Packet Deserialization)
  Fixed bug #70741: Session WDDX Packet Deserialization Type Confusion Vulnerability
  Fixed #70728
  Fixed bug #70755: fpm_log.c memory leak and buffer overflow
  Fix bug #70976: fix boundary check on gdImageRotateInterpolated
  typofix
2016-01-05 19:38:29 -08:00
Stanislav Malyshev
82865dda71 Improve fix for bug #70976 2016-01-04 17:37:54 +01:00
Stanislav Malyshev
84b8db597a Fix bug #70976: fix boundary check on gdImageRotateInterpolated 2016-01-04 17:37:40 +01:00
Lior Kaplan
ed35de784f Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Happy new year (Update copyright to 2016)
2016-01-01 19:48:25 +02:00
Lior Kaplan
49493a2dcf Happy new year (Update copyright to 2016) 2016-01-01 19:21:47 +02:00
Stanislav Malyshev
2baeb167a0 Improve fix for bug #70976 2015-12-28 23:44:14 -08:00
Stanislav Malyshev
4bb422343f Fix bug #70976: fix boundary check on gdImageRotateInterpolated 2015-12-07 23:33:05 -08:00
Christoph M. Becker
f1228ebc61 Merge branch 'pull-request/1425' into PHP-5.6
* pull-request/1425:
  revised bug53156.phpt
  Fix #53156: imagerectangle problem with point ordering
2015-07-21 01:13:04 +02:00
Christoph M. Becker
e7f2356665 Fix #66387: Stack overflow with imagefilltoborder
The stack overflow is caused by the recursive algorithm in combination with a
very large negative coordinate passed to gdImageFillToBorder(). As there is
already a clipping for large positive coordinates to the width and height of
the image, it seems to be consequent to clip to zero also.
2015-07-20 23:36:32 +02:00
Christoph M. Becker
72b73e24a0 Fix #53156: imagerectangle problem with point ordering
Contrary to imagefilledrectangle(), imagerectangle() has the documented
limitation that the given points have to be the upper left and the lower right
corner, respectively. However, libgd already caters to upper right / lower left
pairs, and not catering to the other two combinations seems to be an oversight.
2015-07-20 02:14:29 +02:00
Christoph M. Becker
a31fe58d80 Fix #70102: imagecreatefromwebm() shifts colors
libgd internally uses ARGB format, so we have to decode to ARGB instead of
RGBA.
2015-07-19 22:33:54 +02:00
Christoph M. Becker
d3958b32ca fixed Fix #66590, which may segfault 2015-07-19 21:54:55 +02:00
Christoph M. Becker
96e42403d5 Fix #66590: imagewebp() doesn't pad to even length
The code in the bundled libgd uses libvpx and writes the riff manually. The
code generates the correct even size, but neglects the padding. It's possible
older versions of libwebp would decode this, but libwebp 0.4.0 does not.

Let's apply the patch supplied by one of the WebP developers.
2015-07-19 17:38:04 +02:00
Christoph M. Becker
00ba7e6215 Replaced libvpx by libwebp (first draft; Windows only)
ext/gd/libgd/gd_webp.c has been taken from libgd[1]. Mainly, gd_error(X) has
been subsituted by zend_error(E_ERROR, X) and BGD_DECLARE(X) by X. Further
modifications are obvious from the diff.

All GD tests are passing, what raises hope, but we need more WebP tests,
anyway.

[1] <7ec030c4f1/src/gd_webp.c>
2015-07-21 10:37:06 +02:00
Christoph M. Becker
16d6a93f09 Merge branch 'PHP-5.6'
* PHP-5.6:
  updated NEWS
  revised bug53156.phpt
  Fix #53156: imagerectangle problem with point ordering
2015-07-21 01:20:02 +02:00
Christoph M. Becker
ea37ca7707 Merge branch 'PHP-5.6'
* PHP-5.6:
  updated NEWS
  Fix #66387: Stack overflow with imagefilltoborder
2015-07-20 23:44:04 +02:00
Christoph M. Becker
6c8dbfd5c1 Merge branch 'PHP-5.6'
* PHP-5.6:
  updated NEWS
  Fix #70102: imagecreatefromwebm() shifts colors
2015-07-19 22:40:49 +02:00
Christoph M. Becker
209223b97e Merge branch 'PHP-5.6'
* PHP-5.6:
  fixed Fix #66590, which may segfault
2015-07-19 22:01:20 +02:00
Christoph M. Becker
f9d95a4003 Merge branch 'PHP-5.6'
* PHP-5.6:
  updated NEWS
  Fix #66590: imagewebp() doesn't pad to even length
2015-07-19 17:45:16 +02:00
Christoph M. Becker
20eaa186fb Merge branch 'PHP-5.6'
* PHP-5.6:
  updated NEWS
  Fix #66882: imagerotate by -90 degrees truncates image by 1px
2015-07-13 22:30:43 +02:00
Christoph M. Becker
2e34febb73 Fix #66882: imagerotate by -90 degrees truncates image by 1px
Contrary to the external libgd, the bundled libgd doesn't use optimized
rotation algorithms for negative square angles. We fix that now.

There are other improvements in gdImageRotateInterpolated() in the external
libgd. I'll leave them out for now, in the hope that we'll be able to rejoin
the two libraries rather soon.
2015-07-13 22:18:56 +02:00
Christoph M. Becker
fabc1b7174 Merge branch 'PHP-5.6'
* PHP-5.6:
  updated NEWS
  Fix #70064: imagescale(..., IMG_BICUBIC) leaks memory
2015-07-13 18:36:15 +02:00
Christoph M. Becker
1a4722a89e Fix #70064: imagescale(..., IMG_BICUBIC) leaks memory
A temporary image (tmp_im) is created with gdImageTrueColor() and freed with
gdFree() instead of gdImageDestroy(). Let's fix that.
2015-07-13 18:30:33 +02:00
Christoph M. Becker
959b2c3514 Merge branch 'PHP-5.6'
* PHP-5.6:
  updated NEWS
  Fix #69024: imagescale segfault with palette based image
2015-07-13 15:56:39 +02:00
Christoph M. Becker
fa53d8463f Fix #69024: imagescale segfault with palette based image
imagescale(..., IMG_BICUBIC) is not supposed to work with palette images, so we
fix that by converting to true color if necessary. Basically the same fix has
already been applied to the external libgd[1].

[1] <723ea520be>
2015-07-13 15:48:48 +02:00
Christoph M. Becker
42d1fa29c7 Merge branch 'PHP-5.6'
* PHP-5.6:
  updated NEWS
  Fix #53154: Zero-height rectangle has whiskers
2015-07-13 01:46:09 +02:00
Christoph M. Becker
094decc3c0 Fix #53154: Zero-height rectangle has whiskers
To avoid drawing the corner pixels twice, gdImageRectangle() draws the vertical
lines 2 points shorter than the actual side of the rectangle. However, this
causes "whiskers" for rectangles with height 0. This patch fixes this issue and
at the same time optimizes the algorithm by drawing only a single line for zero
height and zero width rectangles.
2015-07-13 01:33:00 +02:00
Christoph M. Becker
930a9910d7 Merge branch 'PHP-5.6'
* PHP-5.6:
  updated NEWS
  Fix #67447: imagecrop() adds a black line when cropping
2015-07-12 23:15:06 +02:00
Christoph M. Becker
891ff131ef Fix #67447: imagecrop() adds a black line when cropping
A simple one-off error: imagecrop)() copied only width-1 and height-1 pixels.
2015-07-12 23:05:53 +02:00
Christoph M. Becker
ce7b5af03f Merge branch 'PHP-5.6'
* PHP-5.6:
  updated NEWS
  Fix #68714: copy 'n paste error
2015-07-12 16:39:50 +02:00
Christoph M. Becker
ba7c3a1bb4 Fix #68714: copy 'n paste error
Actually, this is not really a bug fix, but rather a simplification and
optimization in the same vein as has been done with the external libgd, but
going a small step further and joining both for loops.
2015-07-12 16:32:38 +02:00
Xinchen Hui
6de750efb7 Fixed conditional jump or move depends on uninitialised value(s)
==11551==    at 0x57CB23C: xpmParseData (parse.c:702)
2015-07-02 19:02:49 +08:00
Remi Collet
fc8143f58a Merge branch 'PHP-5.6'
* PHP-5.6:
  NEWS
  NEWS
  Fixed Bug #69479 GD fails to build with newer libvpx
2015-05-24 09:40:08 +02:00
Remi Collet
565de1ae64 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  NEWS
  Fixed Bug #69479 GD fails to build with newer libvpx
2015-05-24 09:39:20 +02:00
Remi Collet
e807e07bfa Fixed Bug #69479 GD fails to build with newer libvpx
From upstream d41eb72cd4

Fix build with latest libvpx 1.4.0

These new constants exist at least since 1.0.0
Compatibility ones have been droped in 1.4.0
2015-05-24 09:37:12 +02:00
Stanislav Malyshev
736afd48cf Merge branch 'PHP-5.6'
* PHP-5.6:
  Reduce downstream patches
2015-03-22 21:33:52 -07:00
lesniewskister
c12e031530 Reduce downstream patches
As per http://cvsweb.openbsd.org/cgi-bin/cvsweb/ports/lang/php/5.6/patches/patch-ext_gd_libgd_gdcache_h?rev=1.1&content-type=text/x-cvsweb-markup
2015-03-22 21:33:45 -07:00
Xinchen Hui
fc33f52d8c bump year 2015-01-15 23:27:30 +08:00
Xinchen Hui
0579e8278d bump year 2015-01-15 23:26:37 +08:00
Xinchen Hui
73c1be2653 Bump year 2015-01-15 23:26:03 +08:00
Stanislav Malyshev
b7a7b1a624 trailing whitespace removal 2015-01-10 15:07:38 -08:00
Stanislav Malyshev
95183cc339 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  fix memory leak
2015-01-04 21:08:16 -08:00