summaryrefslogtreecommitdiff
path: root/ext/gd/libgd
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'PHP-7.4' into masterChristoph M. Becker2020-08-241-4/+8
|\ | | | | | | | | * PHP-7.4: Fix potential integer overflow detected by oss-fuzz
| * Merge branch 'PHP-7.3' into PHP-7.4Christoph M. Becker2020-08-241-4/+8
| |\ | | | | | | | | | | | | * PHP-7.3: Fix potential integer overflow detected by oss-fuzz
| | * Fix potential integer overflow detected by oss-fuzzChristoph M. Becker2020-08-241-4/+8
| | | | | | | | | | | | | | | | | | We port the respective fix from upstream[1]. [1] <https://github.com/libgd/libgd/commit/9ed642764cf0b4585d135eb738812a43265cb2d3>
* | | Return void from php_jpeg_emit_message()Nikita Popov2020-06-191-5/+2
| | | | | | | | | | | | | | | | | | | | | | | | Instead of returning long and then casting to void. This fixes a build warning on Ubuntu 20.04. Closes GH-5742.
* | | Merge branch 'PHP-7.4'Christoph M. Becker2020-06-121-4/+4
|\ \ \ | |/ / | | | | | | | | | * PHP-7.4: Fix #79676: imagescale adds black border with IMG_BICUBIC
| * | Merge branch 'PHP-7.3' into PHP-7.4Christoph M. Becker2020-06-121-4/+4
| |\ \ | | |/ | | | | | | | | | * PHP-7.3: Fix #79676: imagescale adds black border with IMG_BICUBIC
| | * Fix #79676: imagescale adds black border with IMG_BICUBICChristoph M. Becker2020-06-121-4/+4
| | | | | | | | | | | | | | | We have to loop over all image pixels to avoid the black border. This is also done in external libgd in `_gdScaleOneAxis` and `_gdScalePass`.
* | | Merge branch 'PHP-7.4'Christoph M. Becker2020-05-221-1/+1
|\ \ \ | |/ / | | | | | | | | | * PHP-7.4: Fix #79615: Wrong GIF header written in GD GIFEncode
| * | Merge branch 'PHP-7.3' into PHP-7.4Christoph M. Becker2020-05-221-1/+1
| |\ \ | | |/ | | | | | | | | | * PHP-7.3: Fix #79615: Wrong GIF header written in GD GIFEncode
| | * Fix #79615: Wrong GIF header written in GD GIFEncodeChristoph M. Becker2020-05-221-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | The color resolution is expected in bits 4-6 of the packed fields byte of the logical screen descriptor (byte 10 of the GIF data stream), according to the specification[1], section 18. [1] <https://www.w3.org/Graphics/GIF/spec-gif89a.txt>
* | | Fix [-Wundef] warning in GD extensionGeorge Peter Banyard2020-05-203-4/+4
| | |
* | | Improve some TypeError and ValueError messagesMáté Kocsis2020-04-141-1/+1
| | | | | | | | | | | | Closes GH-5377
* | | Fix [-Wtype-limits] in bundled GD lib by using signed integersGeorge Peter Banyard2020-02-061-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As seen in the gdImageRotateBicubicFixed() function the same setup occurs but it uses signed integers, therefore we use also use signed integers in gdImageRotateBilinear() Moreover, these two functions have been removed upstream in https://github.com/libgd/libgd/commit/bd6d2e101f6f1df106d1cd2e2dc8058a5538109b therefore we should also mimic upstream and remove them... Thanks to @cmb69 for pointing it out.
* | | Make error messages more consistent by fixing capitalizationMáté Kocsis2020-01-173-4/+4
| | | | | | | | | | | | Closes GH-5066 As a first step, let's capitalize their initial letter when it is applicable.
* | | Fix #78880: Final spelling fixesMáté Kocsis2020-01-164-5/+5
| | |
* | | Add imagegetinterpolation()Christoph M. Becker2020-01-141-0/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | While `imagesetinterpolation()` is available as of PHP 5.5.0, there is no according getter function, so users would have to track the current interpolation method manually. To remedy this, we introduce `imagegetinterpolation()` as thin wrapper for `gdImageGetInterpolationMethod()` (which has been introduced with libgd 2.1.1), and use `im->interpolation_id` as fallback for older libgd. Since our bundled libgd does not yet have this function, we add it. We also simplify the recently introduced bug79068.phpt, where it is sufficient to check that the interpolation method has not been changed.
* | | Avoid superfluous assignmentsChristoph M. Becker2020-01-091-2/+0
| | | | | | | | | | | | These values are already set via the initializers.
* | | Fix hypothetical segfault in gdTransformAffineCopy()Christoph M. Becker2020-01-061-3/+13
| | | | | | | | | | | | | | | | | | | | | | | | This has been reported to upstream[1], but since ext/gd never calls `gdTransformAffineCopy()` for a palette image, it is not a bug for PHP. Therefore we apply the fix to master only. [1] <https://github.com/libgd/libgd/issues/586>
* | | Merge branch 'PHP-7.4'Christoph M. Becker2020-01-061-1/+1
|\ \ \ | |/ / | | | | | | | | | * PHP-7.4: Fix #79068: gdTransformAffineCopy() changes interpolation method
| * | Merge branch 'PHP-7.3' into PHP-7.4Christoph M. Becker2020-01-061-1/+1
| |\ \ | | |/ | | | | | | | | | * PHP-7.3: Fix #79068: gdTransformAffineCopy() changes interpolation method
| | * Fix #79068: gdTransformAffineCopy() changes interpolation methodChristoph M. Becker2020-01-061-1/+1
| | | | | | | | | | | | | | | We port <https://github.com/libgd/libgd/commit/9088591eae437358ee5b929adf82865e37e3001e>.
* | | Merge branch 'PHP-7.4'Christoph M. Becker2020-01-062-3/+6
|\ \ \ | |/ / | | | | | | | | | * PHP-7.4: Fix #79067: gdTransformAffineCopy() may use unitialized values
| * | Merge branch 'PHP-7.3' into PHP-7.4Christoph M. Becker2020-01-062-3/+6
| |\ \ | | |/ | | | | | | | | | * PHP-7.3: Fix #79067: gdTransformAffineCopy() may use unitialized values
| | * Fix #79067: gdTransformAffineCopy() may use unitialized valuesChristoph M. Becker2020-01-062-3/+6
| | | | | | | | | | | | | | | We port <https://github.com/libgd/libgd/commit/7a06c1669c563917bc48c464521e3de962ddb4e8>.
* | | Merge branch 'PHP-7.4'Christoph M. Becker2019-12-071-0/+1
|\ \ \ | |/ / | | | | | | | | | * PHP-7.4: Fix #78923: Artifacts when convoluting image with transparency
| * | Merge branch 'PHP-7.3' into PHP-7.4Christoph M. Becker2019-12-071-0/+1
| |\ \ | | |/ | | | | | | | | | * PHP-7.3: Fix #78923: Artifacts when convoluting image with transparency
| | * Fix #78923: Artifacts when convoluting image with transparencywillson-chen2019-12-071-0/+1
| | | | | | | | | | | | | | | | | | We have to properly initialize `pxl` before using it. Fix ported from <https://github.com/libgd/libgd/pull/559>.
* | | Merge branch 'PHP-7.4'Christoph M. Becker2019-11-211-1/+1
|\ \ \ | |/ / | | | | | | | | | * PHP-7.4: Fix #78849: GD build broken with -D SIGNED_COMPARE_SLOW
| * | Merge branch 'PHP-7.3' into PHP-7.4Christoph M. Becker2019-11-211-1/+1
| |\ \ | | |/ | | | | | | | | | * PHP-7.3: Fix #78849: GD build broken with -D SIGNED_COMPARE_SLOW
| | * Merge branch 'PHP-7.2' into PHP-7.3Christoph M. Becker2019-11-211-1/+1
| | |\ | | | | | | | | | | | | | | | | * PHP-7.2: Fix #78849: GD build broken with -D SIGNED_COMPARE_SLOW
| | | * Fix #78849: GD build broken with -D SIGNED_COMPARE_SLOWChristoph M. Becker2019-11-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Apparently, this has not been tested for a long time, and might be a refactoring relict. Anyhow, we have to pass the context to `GIFNextPixel` as well.
* | | | Remove mention of PHP major version in Copyright headersGabriel Caruso2019-09-251-2/+0
|/ / / | | | | | | | | | Closes GH-4732.
* | | Remove superfluous HAVE_GD_BUNDLED checksChristoph M. Becker2019-07-223-17/+4
| | | | | | | | | | | | | | | If we're compiling the bundled libgd, `HAVE_GD_BUNDLED` is set, so there is no need to check for this macro again.
* | | Use e.g. instead of less common f.e. [ci skip]Peter Kokot2019-07-091-1/+1
| | |
* | | Remove HAVE_ERRNO_H from libgdPeter Kokot2019-06-281-6/+0
| | | | | | | | | | | | | | | | | | | | | | | | The check for errno.h has been removed via 50b9ef8d9435d23be40cea7fb484a02e99fdb617 Upstream libgd library is also patched via https://github.com/libgd/libgd/commit/1e7f93922fb3adf9f131d7e94aa13386062ffe11
* | | Support TGA readingChristoph M. Becker2019-06-203-0/+416
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We add PHP bindings for libgd's features to read TGA files, which are available as of libgd 2.1.0. As PHP's bundled libgd doesn't yet include the respective features of the external libgd, we add these. Since TGA has no easily recognizable file signature, we don't add TGA support for imagecreatefromstring() or getimagesize() and friends.
* | | Suppress shift UB in gd_itofx()Nikita Popov2019-06-191-2/+2
| | | | | | | | | | | | There doesn't seem to be a corresponding upstream fix for this.
* | | Fix buffer underflow in gd_gif_in.cNikita Popov2019-06-191-1/+1
| | | | | | | | | | | | | | | This has been fixed upstream in https://github.com/libgd/libgd/commit/939d49a3a9d1cbcd2a37cea9eac9f9e5e9f9de78.
* | | Fix shift UB in gd_io.cNikita Popov2019-06-191-2/+2
| | | | | | | | | | | | | | | | | | | | | This has already been fixed upstream in https://github.com/libgd/libgd/commit/24d352576c024769d18113a28f3be03d54fa1e66 and https://github.com/libgd/libgd/commit/772d0107a6b00a0d6d7191383fe984f8c018b48c.
* | | Remove unused _setEdgePixel() and getPixelOverflowColorTC() functionsNikita Popov2019-06-111-56/+0
| | |
* | | Fix fabs warning in gd_interpolation.cNikita Popov2019-06-111-2/+2
| | | | | | | | | | | | Matches upstream code.
* | | Remove safeboolean use in gd_jpeg.cNikita Popov2019-06-111-16/+3
| | | | | | | | | | | | | | | This is a backport of https://github.com/libgd/libgd/blob/e5502c7a3f1fe60536ec060f0211d97066c006ea/src/gd_jpeg.c.
* | | Fix abs(long) warnings in gd.cNikita Popov2019-06-111-1/+1
| | | | | | | | | | | | | | | I'm fixing this using (int) casts instead of labs() because this is what upstream GD does.
* | | Merge branch 'PHP-7.3' into PHP-7.4Stanislav Malyshev2019-05-271-1/+1
|\ \ \ | |/ / | | | | | | | | | * PHP-7.3: Fix function name
| * | Merge branch 'PHP-7.2' into PHP-7.3Stanislav Malyshev2019-05-271-1/+1
| |\ \ | | |/ | | | | | | | | | * PHP-7.2: Fix function name
| | * Fix function nameStanislav Malyshev2019-05-271-1/+1
| | |
* | | Merge branch 'PHP-7.3' into PHP-7.4Stanislav Malyshev2019-05-271-1/+5
|\ \ \ | |/ / | | | | | | | | | | | | | | | * PHP-7.3: Update NEWS Fix bug #78069 - Out-of-bounds read in iconv.c:_php_iconv_mime_decode() due to integer overflow Fix #77973: Uninitialized read in gdImageCreateFromXbm
| * | Merge branch 'PHP-7.2' into PHP-7.3Stanislav Malyshev2019-05-271-1/+5
| |\ \ | | |/ | | | | | | | | | | | | | | | * PHP-7.2: Update NEWS Fix bug #78069 - Out-of-bounds read in iconv.c:_php_iconv_mime_decode() due to integer overflow Fix #77973: Uninitialized read in gdImageCreateFromXbm
| | * Merge branch 'PHP-7.1' into PHP-7.2Stanislav Malyshev2019-05-271-1/+5
| | |\ | | | | | | | | | | | | | | | | | | | | | | | | * PHP-7.1: Update NEWS Fix bug #78069 - Out-of-bounds read in iconv.c:_php_iconv_mime_decode() due to integer overflow Fix #77973: Uninitialized read in gdImageCreateFromXbm
| | | * Fix #77973: Uninitialized read in gdImageCreateFromXbmChristoph M. Becker2019-05-271-1/+5
| | | | | | | | | | | | | | | | | | | | We have to ensure that `sscanf()` does indeed read a hex value here, and bail out otherwise.