summaryrefslogtreecommitdiff
path: root/ext/gd/libgd
Commit message (Collapse)AuthorAgeFilesLines
...
* | | | Migrate ext/gd to pkg-configNikita Popov2019-01-151-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * --with-webp-dir becomes --with-webp * --with-jpeg-dir becomes --with-jpeg * --with-png-dir is removed. libpng is required. * --with-zlib-dir is removed. zlib is required. * --with-xpm-dir becomes --with-xpm. We also enable --with-webp on Travis.
* | | | Fix misleading variable typeChristoph M. Becker2019-01-111-2/+2
| | | | | | | | | | | | | | | | We port libgd/libgd@0414bb2da0b27d90b6125bd34a3e2cfb89fd3f42.
* | | | Remove unused variables and functionsChristoph M. Becker2019-01-101-7/+16
| | | | | | | | | | | | | | | | | | | | | | | | We remove the unused variables altogether, and port libgd/libgd@f50c24e467f1f44f0ede90bc7d2d8eaadbe11094 to silence the compiler warnings.
* | | | Merge branch 'PHP-7.3'Christoph M. Becker2019-01-101-81/+10
|\ \ \ \ | |/ / / | | | | | | | | | | | | * PHP-7.3: Fix #73281: imagescale(…, IMG_BILINEAR_FIXED) can cause black border
| * | | Merge branch 'PHP-7.2' into PHP-7.3Christoph M. Becker2019-01-101-81/+10
| |\ \ \ | | |/ / | | | | | | | | | | | | * PHP-7.2: Fix #73281: imagescale(…, IMG_BILINEAR_FIXED) can cause black border
| | * | Fix #73281: imagescale(…, IMG_BILINEAR_FIXED) can cause black borderChristoph M. Becker2019-01-101-81/+10
| | | | | | | | | | | | | | | | We port the upstream fixes for libgd/libgd#329 and libgd/libgd#224.
* | | | Merge branch 'PHP-7.3'Christoph M. Becker2019-01-101-26/+17
|\ \ \ \ | |/ / / | | | | | | | | | | | | * PHP-7.3: Fix #77272: imagescale() may return image resource on failure
| * | | Merge branch 'PHP-7.2' into PHP-7.3Christoph M. Becker2019-01-101-26/+17
| |\ \ \ | | |/ / | | | | | | | | | | | | * PHP-7.2: Fix #77272: imagescale() may return image resource on failure
| | * | Fix #77272: imagescale() may return image resource on failureChristoph M. Becker2019-01-101-26/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `_gdScaleHoriz()` and `_gdScaleVert()` may fail, but don't signal failure since they are void functions. We change that according to upstream libgd. We also remove the unused `Scale()` function, which doesn't exist in upstream libgd either, right away.
* | | | Merge branch 'PHP-7.3'Stanislav Malyshev2019-01-062-11/+11
|\ \ \ \ | |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * PHP-7.3: Fix #77367: Negative size parameter in mb_split Fix #77369 - memcpy with negative length via crafted DNS response Fix more issues with encodilng length Fix #77270: imagecolormatch Out Of Bounds Write on Heap Fix bug #77380 (Global out of bounds read in xmlrpc base64 code) Fix bug #77371 (heap buffer overflow in mb regex functions - compile_string_node) Fix bug #77370 - check that we do not read past buffer end when parsing multibytes Fix #77269: Potential unsigned underflow in gdImageScale Fix bug #77247 (heap buffer overflow in phar_detect_phar_fname_ext) Fix bug #77242 (heap out of bounds read in xmlrpc_decode()) Regenerate certs for openssl tests
| * | | Merge branch 'PHP-7.2' into PHP-7.3Stanislav Malyshev2019-01-062-11/+11
| |\ \ \ | | |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * PHP-7.2: Fix #77369 - memcpy with negative length via crafted DNS response Fix more issues with encodilng length Fix #77270: imagecolormatch Out Of Bounds Write on Heap Fix bug #77380 (Global out of bounds read in xmlrpc base64 code) Fix bug #77371 (heap buffer overflow in mb regex functions - compile_string_node) Fix bug #77370 - check that we do not read past buffer end when parsing multibytes Fix #77269: Potential unsigned underflow in gdImageScale Fix bug #77247 (heap buffer overflow in phar_detect_phar_fname_ext) Fix bug #77242 (heap out of bounds read in xmlrpc_decode()) Regenerate certs for openssl tests
| | * | Merge branch 'PHP-7.1' into PHP-7.2Stanislav Malyshev2019-01-062-11/+11
| | |\ \ | | | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * PHP-7.1: Fix #77369 - memcpy with negative length via crafted DNS response Fix more issues with encodilng length Fix #77270: imagecolormatch Out Of Bounds Write on Heap Fix bug #77380 (Global out of bounds read in xmlrpc base64 code) Fix bug #77371 (heap buffer overflow in mb regex functions - compile_string_node) Fix bug #77370 - check that we do not read past buffer end when parsing multibytes Fix #77269: Potential unsigned underflow in gdImageScale Fix bug #77247 (heap buffer overflow in phar_detect_phar_fname_ext) Fix bug #77242 (heap out of bounds read in xmlrpc_decode()) Regenerate certs for openssl tests
| | | * Fix #77270: imagecolormatch Out Of Bounds Write on HeapChristoph M. Becker2019-01-061-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | At least some of the image reading functions may return images which use color indexes greater than or equal to im->colorsTotal. We cater to this by always using a buffer size which is sufficient for `gdMaxColors` in `gdImageColorMatch()`.
| | | * Fix #77269: Potential unsigned underflow in gdImageScaleChristoph M. Becker2019-01-061-9/+9
| | | | | | | | | | | | | | | | | | | | | | | | Belatedly, we're porting the respective upstream patch[1]. [1] <https://github.com/libgd/libgd/commit/60bfb401ad5a4a8ae995dcd36372fe15c71e1a35>
* | | | Merge branch 'PHP-7.3'Christoph M. Becker2018-12-311-2/+2
|\ \ \ \ | |/ / / | | | | | | | | | | | | * PHP-7.3: Fix #77391: 1bpp BMPs may fail to be loaded
| * | | Merge branch 'PHP-7.2' into PHP-7.3Christoph M. Becker2018-12-311-2/+2
| |\ \ \ | | |/ / | | | | | | | | | | | | * PHP-7.2: Fix #77391: 1bpp BMPs may fail to be loaded
| | * | Fix #77391: 1bpp BMPs may fail to be loadedChristoph M. Becker2018-12-311-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | We port the upstream fix[1]. [1] <https://github.com/libgd/libgd/commit/d0859134fcbd8817f87895bd1cb158096568a7a2>
* | | | Fix #73291: imagecropauto() $threshold differs from external libgdChristoph M. Becker2018-12-011-5/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since upstream does not appear to move in any way[1], we sync our behavior. Even though the BC break is ugly (which is the reason we target master only), having to deal with different algorithms is even worse for portable userland code. [1] <https://github.com/libgd/libgd/issues/334>
* | | | Sync behavior of gdImageAutoCrop() with upstreamChristoph M. Becker2018-12-011-6/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since cropping support has been added to our bundled libgd, `gdImageAutoCrop` differs from upstream in that `GD_CROP_DEFAULT` falls back on `GD_CROP_SIDES` if there is no transparent color in the image. While this difference seem to be a useful improvement in our bundled libgd, upstream has not yet signaled that there willing to back-port it[1], so we revert it to stay in sync with upstream. We also remove the additional NULL bailout at the end of the function, which doesn't appear to be relevant any longer since bug 77198 has been fixed. [1] <https://github.com/libgd/libgd/issues/298>
* | | | Merge branch 'PHP-7.3'Christoph M. Becker2018-11-251-1/+1
|\ \ \ \ | |/ / / | | | | | | | | | | | | * PHP-7.3: Fix #77200: imagecropauto(…, GD_CROP_SIDES) crops left but not right
| * | | Merge branch 'PHP-7.2' into PHP-7.3Christoph M. Becker2018-11-251-1/+1
| |\ \ \ | | |/ / | | | | | | | | | | | | * PHP-7.2: Fix #77200: imagecropauto(…, GD_CROP_SIDES) crops left but not right
| | * | Fix #77200: imagecropauto(…, GD_CROP_SIDES) crops left but not rightChristoph M. Becker2018-11-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | We apply the upstream patch[1]. [1] <https://github.com/libgd/libgd/commit/6613094e5d218dc4d4372757aef5e58c6462a9f7>
* | | | Merge branch 'PHP-7.3'Christoph M. Becker2018-11-251-28/+16
|\ \ \ \ | |/ / / | | | | | | | | | | | | * PHP-7.3: Fix #77198: auto cropping has insufficient precision
| * | | Merge branch 'PHP-7.2' into PHP-7.3Christoph M. Becker2018-11-251-28/+16
| |\ \ \ | | |/ / | | | | | | | | | | | | * PHP-7.2: Fix #77198: auto cropping has insufficient precision
| | * | Fix #77198: auto cropping has insufficient precisionChristoph M. Becker2018-11-251-28/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We apply the upstream patch[1], and also fix the erroneous bailout at the end of `gdImageAutoCrop()`, since `crop.x` and `crop.y` may very well be zero. [1] <https://github.com/libgd/libgd/commit/bda85aaeeb1d7467d92c892ba4c30eaa53d7a6d4>
* | | | Merge branch 'PHP-7.3'Christoph M. Becker2018-11-241-4/+9
|\ \ \ \ | |/ / / | | | | | | | | | | | | * PHP-7.3: Fix #77195: Incorrect error handling of imagecreatefromjpeg()
| * | | Merge branch 'PHP-7.2' into PHP-7.3Christoph M. Becker2018-11-241-4/+9
| |\ \ \ | | |/ / | | | | | | | | | | | | * PHP-7.2: Fix #77195: Incorrect error handling of imagecreatefromjpeg()
| | * | Fix #77195: Incorrect error handling of imagecreatefromjpeg()Christoph M. Becker2018-11-241-4/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The broken JPEG image triggers a notice, two warnings and outputs a message to stderr directly. The additional notice is pretty useless, and the direct output to stderr is bad. Therefore, we port the relevant differences from upstream to our bundled libgd. This leaves us with two warnings; the first one is triggered by libjpeg and shows the actual problem, the second one is triggered by our libgd wrapper whenever an image can't be read, what may not have necessarily triggered a warning before.
* | | | Remove HAVE_SYS_VARARGS_HPeter Kokot2018-09-161-11/+1
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Outdated systems used to provide the `<varargs.h>` and in case of PHP `<sys/varargs.h>`. [1] Current systems have `<stdarg.h>` which is also a C89 standard header and systems have it always present. [2] [1] https://en.wikipedia.org/wiki/Stdarg.h#varargs.h [2] https://port70.net/~nsz/c/c89/c89-draft.html#4.1.2
* | | Remove extra semicolonsGabriel Caruso2018-07-252-4/+2
| | |
* | | Merge branch 'PHP-7.2'Christoph M. Becker2018-03-301-1/+0
|\ \ \ | |/ / | | | | | | | | | * PHP-7.2: Fix #52070: imagedashedline() - dashed line sometimes is not visible
| * | Merge branch 'PHP-7.1' into PHP-7.2Christoph M. Becker2018-03-301-1/+0
| |\ \ | | |/ | | | | | | | | | * PHP-7.1: Fix #52070: imagedashedline() - dashed line sometimes is not visible
| | * Fix #52070: imagedashedline() - dashed line sometimes is not visibleChristoph M. Becker2018-03-301-1/+0
| | | | | | | | | | | | | | | We finally remove the inadvertent leftover from the synchronization with GD 2.0.12.
| | * Merge branch 'PHP-7.1' of git.php.net:/php-src into PHP-7.1Xinchen Hui2018-01-021-5/+5
| | |\ | | | | | | | | | | | | | | | | | | | | | | | | * 'PHP-7.1' of git.php.net:/php-src: Update NEWS Fixed bug #75571: Potential infinite loop in gdImageCreateFromGifCtx Fix bug #74782: remove file name from output to avoid XSS
| | * | year++Xinchen Hui2018-01-021-1/+1
| | | |
* | | | Merge branch 'PHP-7.2'Christoph M. Becker2018-03-021-0/+6
|\ \ \ \ | |/ / / | | | | | | | | | | | | * PHP-7.2: Fix #76041: null pointer access crashed php
| * | | Fix #76041: null pointer access crashed phpChristoph M. Becker2018-03-021-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | We must not draw anti-aliased lines on palette images, because that is not supported by `gdImageSetAAPixelColor()` and it wouldn't make much sense to support it, due to the limitation to at most 256 colors.
| * | | Merge branch 'PHP-7.2' of git.php.net:/php-src into PHP-7.2Xinchen Hui2018-01-021-5/+5
| |\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 'PHP-7.2' of git.php.net:/php-src: Update NEWS Fixed bug #75571: Potential infinite loop in gdImageCreateFromGifCtx Fix bug #74782: remove file name from output to avoid XSS
| * | | | year++Xinchen Hui2018-01-021-1/+1
| | | | |
* | | | | Removed unused variablesGabriel Caruso2018-02-111-4/+0
| | | | |
* | | | | Align overflow error messages with upstreamChristoph M. Becker2018-02-101-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | This particularly fixes two tests (bug66356.phpt and bug72339.phpt) if PHP has been build with an external libgd.
* | | | | Remove unused functionChristoph M. Becker2018-02-092-7/+0
| | | | |
* | | | | Fix some misspellingsGabriel Caruso2018-02-061-4/+4
| | | | |
* | | | | Remove unused variableChristoph M. Becker2018-02-061-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We're not interested in the return value of `gdGuessBackgroundColorFromCorners`, so there's no need to track it. See also libgd/libgd@535eab566b4a412eef21347653fb98a48857d169.
* | | | | Sync gdImageCrop() with upstreamChristoph M. Becker2018-02-021-43/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Besides that we still hope to sync the complete bundled libgd sometime, the upstream implementation of `gdImageCrop()` is much simpler than the current one, and thus better readable and less error prone.
* | | | | Trailing whitespacesGabriel Caruso2018-01-033-4/+4
| | | | | | | | | | | | | | | | | | | | Signed-off-by: Gabriel Caruso <carusogabriel34@gmail.com>
* | | | | Merge branch 'master' of git.php.net:/php-srcXinchen Hui2018-01-021-5/+5
|\ \ \ \ \ | | |/ / / | |/| | | | | | | | | | | | | | | | | | | | | | | * 'master' of git.php.net:/php-src: Update NEWS Fixed bug #75571: Potential infinite loop in gdImageCreateFromGifCtx Fix bug #74782: remove file name from output to avoid XSS
| * | | | Merge branch 'PHP-7.1' into PHP-7.2Stanislav Malyshev2018-01-011-5/+5
| |\ \ \ \ | | |/ / / | |/| | / | | | |/ | | |/| | | | | | | | | * PHP-7.1: Update NEWS Fixed bug #75571: Potential infinite loop in gdImageCreateFromGifCtx Fix bug #74782: remove file name from output to avoid XSS
| | * | Merge branch 'PHP-5.6' into PHP-7.0Stanislav Malyshev2018-01-011-5/+5
| | |\ \ | | | |/ | | |/| | | | | | | | | | | | | | | | | * PHP-5.6: Update NEWS Fixed bug #75571: Potential infinite loop in gdImageCreateFromGifCtx Fix bug #74782: remove file name from output to avoid XSS
| | | * Fixed bug #75571: Potential infinite loop in gdImageCreateFromGifCtxChristoph M. Becker2018-01-011-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Due to a signedness confusion in `GetCode_` a corrupt GIF file can trigger an infinite loop. Furthermore we make sure that a GIF without any palette entries is treated as invalid *after* open palette entries have been removed.