summaryrefslogtreecommitdiff
path: root/ext/gd/libgd/gd_interpolation.c
Commit message (Collapse)AuthorAgeFilesLines
* 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`.
* | | 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.
* | | 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.
* | | 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.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.3' into PHP-7.4Christoph M. Becker2020-01-061-2/+5
|\ \ | |/ | | | | | | * PHP-7.3: Fix #79067: gdTransformAffineCopy() may use unitialized values
| * Fix #79067: gdTransformAffineCopy() may use unitialized valuesChristoph M. Becker2020-01-061-2/+5
| | | | | | | | | | We port <https://github.com/libgd/libgd/commit/7a06c1669c563917bc48c464521e3de962ddb4e8>.
* | Use e.g. instead of less common f.e. [ci skip]Peter Kokot2019-07-091-1/+1
| |
* | Suppress shift UB in gd_itofx()Nikita Popov2019-06-191-2/+2
| | | | | | | | There doesn't seem to be a corresponding upstream fix for this.
* | 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.
* | 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.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.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.2' into PHP-7.3Stanislav Malyshev2019-01-061-9/+9
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | * 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
| * 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>
* | Removed unused variablesGabriel Caruso2018-02-111-4/+0
| |
* | Trailing whitespacesGabriel Caruso2018-01-031-2/+2
|/ | | | Signed-off-by: Gabriel Caruso <carusogabriel34@gmail.com>
* Define floorf if system doesn't have it (follow up for 22c48761)Lior Kaplan2017-11-291-0/+10
| | | | floorf is checked in config.m4
* Fixed bug #65148 (imagerotate may alter image dimensions)Christoph M. Becker2017-10-241-22/+65
| | | | | | | | | We apply the respective patches from external libgd, work around the still missing `gdImageClone()`, and fix the special cased rotation routines according to Pierre's patch (https://gist.github.com/pierrejoye/59d72385ed1888cf8894a7ed437235ae). We also cater to bug73272.phpt whose result obviously changes a bit.
* Fixed bug #75139 (libgd/gd_interpolation.c:1786: suspicious if ?)Christoph M. Becker2017-09-021-2/+2
| | | | | | | | We back-port https://github.com/libgd/libgd/commit/dd48286 even though we cannot come up with a regression test, because the erroneous condition appears to be impossible to trigger. We also parenthesize the inner ternary operation to avoid confusion.
* Fix #73279: Integer overflow in gdImageScaleBilinearPalette()Christoph M. Becker2016-10-101-4/+4
| | | | | | | 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 <https://github.com/libgd/libgd/commit/77c8d359>.
* Fix #68712: suspicious if-else statementsChristoph M. Becker2016-07-231-28/+8
|
* Fix copy&paste errors in gd_interpolation.cChristoph M. Becker2016-07-231-4/+4
| | | | According to <https://github.com/libgd/libgd/commit/f101380>.
* improve fix #72558, free contribRow as wellPierre Joye2016-07-191-0/+1
|
* improve fix #72558, while (u>=0) with unsigned int will always be truePierre Joye2016-07-191-3/+4
|
* Merge branch 'PHP-5.5' into PHP-5.6Stanislav Malyshev2016-07-191-0/+1
|\ | | | | | | | | * PHP-5.5: Fix memory leak
| * Fix memory leakStanislav Malyshev2016-07-191-0/+1
| |
* | Merge branch 'PHP-5.5' into PHP-5.6Stanislav Malyshev2016-07-191-47/+69
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
| * fix #72512, invalid read or write for palette image when invalid transparent ↵Pierre Joye2016-07-191-1/+7
| | | | | | | | | | | | | | index is used Conflicts: ext/gd/libgd/gd.c
| * Fix for bug #72558, Integer overflow error within _gdContributionsAlloc()Stanislav Malyshev2016-07-181-47/+69
| |
* | Merge branch 'PHP-5.5' into PHP-5.6Pierre Joye2016-07-191-1/+7
|\ \ | | | | | | | | | | | | * PHP-5.5: fix #72512, invalid read or write for palette image when invalid transparent index is used
| * | fix #72512, invalid read or write for palette image when invalid transparent ↵Pierre Joye2016-07-191-1/+7
| |/ | | | | | | index is used
* | Merge branch 'PHP-5.5' into PHP-5.6.23Stanislav Malyshev2016-06-211-0/+3
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
| * Fix bug #72407: NULL Pointer Dereference at _gdScaleVertStanislav Malyshev2016-06-181-0/+3
| |
* | #72337 invalid dimensions can lead to segvPierre Joye2016-06-071-1/+33
| |
* | Merge branch 'PHP-5.5' into PHP-5.6.22Stanislav Malyshev2016-05-241-9/+9
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
| * Fix memory leak in imagescale()Stanislav Malyshev2016-05-241-3/+3
| |
| * Fixed bug #72227: imagescale out-of-bounds readStanislav Malyshev2016-05-231-8/+8
| | | | | | | | Ported from https://github.com/libgd/libgd/commit/4f65a3e4eedaffa1efcf9ee1eb08f0b504fbc31a
| * fix the fix for bug #70976 (imagerotate)Remi Collet2016-01-121-2/+2
| |
* | fix the fix for bug #70976 (imagerotate)Remi Collet2016-01-121-2/+2
| |
* | Merge branch 'PHP-5.5' into PHP-5.6Stanislav Malyshev2016-01-051-1/+1
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | * 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
| * Improve fix for bug #70976Stanislav Malyshev2015-12-281-1/+1
| |
| * Fix bug #70976: fix boundary check on gdImageRotateInterpolatedStanislav Malyshev2015-12-071-1/+1
| |