From 1392eab89b9c7e6bbc1fa5a1d3af2434bcb04e5d Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Thu, 19 Sep 2024 09:21:23 +1000 Subject: [PATCH 1/7] Updated Ghostscript to 10.4.0 --- .appveyor.yml | 4 ++-- .github/workflows/test-windows.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index f490561cd..de5e52742 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -34,8 +34,8 @@ install: - xcopy /S /Y c:\test-images-main\* c:\pillow\tests\images - curl -fsSL -o nasm-win64.zip https://raw.githubusercontent.com/python-pillow/pillow-depends/main/nasm-2.16.03-win64.zip - 7z x nasm-win64.zip -oc:\ -- choco install ghostscript --version=10.3.1 -- path c:\nasm-2.16.03;C:\Program Files\gs\gs10.03.1\bin;%PATH% +- choco install ghostscript --version=10.4.0 +- path c:\nasm-2.16.03;C:\Program Files\gs\gs10.04.0\bin;%PATH% - cd c:\pillow\winbuild\ - ps: | c:\python39\python.exe c:\pillow\winbuild\build_prepare.py -v --depends=C:\pillow-depends\ diff --git a/.github/workflows/test-windows.yml b/.github/workflows/test-windows.yml index f58e8dae3..13147d86b 100644 --- a/.github/workflows/test-windows.yml +++ b/.github/workflows/test-windows.yml @@ -86,8 +86,8 @@ jobs: choco install nasm --no-progress echo "C:\Program Files\NASM" >> $env:GITHUB_PATH - choco install ghostscript --version=10.3.1 --no-progress - echo "C:\Program Files\gs\gs10.03.1\bin" >> $env:GITHUB_PATH + choco install ghostscript --version=10.4.0 --no-progress + echo "C:\Program Files\gs\gs10.04.0\bin" >> $env:GITHUB_PATH # Install extra test images xcopy /S /Y Tests\test-images\* Tests\images From 0f47ecd4325268156c27fa86799d31829f31fcea Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Thu, 19 Sep 2024 15:07:06 +1000 Subject: [PATCH 2/7] Update CHANGES.rst [ci skip] --- CHANGES.rst | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/CHANGES.rst b/CHANGES.rst index f23ec609f..4ab9eaf2b 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -5,6 +5,18 @@ Changelog (Pillow) 11.0.0 (unreleased) ------------------- +- Use transposed size after opening for TIFF images #8390 + [radarhere, homm] + +- Improve ImageFont error messages #8338 + [yngvem, radarhere, hugovk] + +- Mention MAX_TEXT_CHUNK limit in PNG error message #8391 + [radarhere] + +- Cast Dib handle to int #8385 + [radarhere] + - Accept float stroke widths #8369 [radarhere] From 46f2fa17be9768ec2647988b0446dd848b833a5b Mon Sep 17 00:00:00 2001 From: PavlNekrasov <95914807+PavlNekrasov@users.noreply.github.com> Date: Thu, 19 Sep 2024 22:53:45 +0300 Subject: [PATCH 3/7] fix dereference before checking for NULL in the `ImagingTransformAffine` function The `imIn` pointer is checked for `NULL`, but it seems to be dereferenced before this check. You must first make sure that the pointer is not `NULL` before using it. --- src/libImaging/Geometry.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/libImaging/Geometry.c b/src/libImaging/Geometry.c index 2bfeed7b6..264c7d169 100644 --- a/src/libImaging/Geometry.c +++ b/src/libImaging/Geometry.c @@ -1035,6 +1035,10 @@ ImagingTransformAffine( double xx, yy; double xo, yo; + if (!imOut || !imIn || strcmp(imIn->mode, imOut->mode) != 0) { + return (Imaging)ImagingError_ModeError(); + } + if (filterid || imIn->type == IMAGING_TYPE_SPECIAL) { return ImagingGenericTransform( imOut, imIn, x0, y0, x1, y1, affine_transform, a, filterid, fill @@ -1046,10 +1050,6 @@ ImagingTransformAffine( return ImagingScaleAffine(imOut, imIn, x0, y0, x1, y1, a, fill); } - if (!imOut || !imIn || strcmp(imIn->mode, imOut->mode) != 0) { - return (Imaging)ImagingError_ModeError(); - } - if (x0 < 0) { x0 = 0; } From 9424b1a8920201b52086c0b06b5148db33255668 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 19 Sep 2024 19:59:08 +0000 Subject: [PATCH 4/7] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- src/libImaging/Geometry.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libImaging/Geometry.c b/src/libImaging/Geometry.c index 264c7d169..84aa442f0 100644 --- a/src/libImaging/Geometry.c +++ b/src/libImaging/Geometry.c @@ -1037,7 +1037,7 @@ ImagingTransformAffine( if (!imOut || !imIn || strcmp(imIn->mode, imOut->mode) != 0) { return (Imaging)ImagingError_ModeError(); - } + } if (filterid || imIn->type == IMAGING_TYPE_SPECIAL) { return ImagingGenericTransform( From 693a68b2bb7fdf01bbafb7070320c16ec57ca78d Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Fri, 20 Sep 2024 18:46:47 +1000 Subject: [PATCH 5/7] Updated link to OSS Fuzz issues --- README.md | 2 +- docs/index.rst | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index b4c6d2987..5bbebaccb 100644 --- a/README.md +++ b/README.md @@ -51,7 +51,7 @@ As of 2019, Pillow development is Code coverage - Fuzzing Status diff --git a/docs/index.rst b/docs/index.rst index 3a12953f0..18f5c3d13 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -54,7 +54,7 @@ Pillow for enterprise is available via the Tidelift Subscription. `Learn more Date: Sun, 22 Sep 2024 22:46:35 +0200 Subject: [PATCH 6/7] winbuild: Build freetype.vcxproj to fix passing in custom parameters. --- winbuild/build_prepare.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/winbuild/build_prepare.py b/winbuild/build_prepare.py index e2022d283..d350e2575 100644 --- a/winbuild/build_prepare.py +++ b/winbuild/build_prepare.py @@ -292,8 +292,12 @@ DEPS: dict[str, dict[str, Any]] = { }, "build": [ cmd_rmdir("objs"), - cmd_msbuild("MSBuild.sln", "Release Static", "Clean"), - cmd_msbuild("MSBuild.sln", "Release Static", "Build"), + cmd_msbuild( + r"builds\windows\vc2010\freetype.vcxproj", "Release Static", "Clean" + ), + cmd_msbuild( + r"builds\windows\vc2010\freetype.vcxproj", "Release Static", "Build" + ), cmd_xcopy("include", "{inc_dir}"), ], "libs": [r"objs\{msbuild_arch}\Release Static\freetype.lib"], From 8adf15a6ee1bab667a0e7b76d19ea0f26b29ce85 Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Mon, 23 Sep 2024 09:29:16 +1000 Subject: [PATCH 7/7] Updated raqm to 0.10.2 --- depends/install_raqm.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/depends/install_raqm.sh b/depends/install_raqm.sh index 070ba23a1..5d862403e 100755 --- a/depends/install_raqm.sh +++ b/depends/install_raqm.sh @@ -2,7 +2,7 @@ # install raqm -archive=libraqm-0.10.1 +archive=libraqm-0.10.2 ./download-and-extract.sh $archive https://raw.githubusercontent.com/python-pillow/pillow-depends/main/$archive.tar.gz