From 5d7ef421df25d2ee137aea90a6c94ac1d48379f5fc244dcfd7687e8bc13fa9f6 Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Wed, 30 Dec 2020 14:03:15 +0000 Subject: [PATCH] Accepting request 859409 from home:pgajdos:python - fix build with libtiff 4.2.0 - added patches fix https://github.com/python-pillow/Pillow/pull/5153 + python-Pillow-tiff-4.2.0.patch fix https://github.com/python-pillow/Pillow/commit/416f12e772d2b3cb920b18b3625e8b1419d7519e + python-Pillow-tiff-fix-oob-read.patch OBS-URL: https://build.opensuse.org/request/show/859409 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-Pillow?expand=0&rev=106 --- python-Pillow-tiff-4.2.0.patch | 14 ++++++++++++++ python-Pillow-tiff-fix-oob-read.patch | 22 ++++++++++++++++++++++ python-Pillow.changes | 10 ++++++++++ python-Pillow.spec | 6 ++++++ 4 files changed, 52 insertions(+) create mode 100644 python-Pillow-tiff-4.2.0.patch create mode 100644 python-Pillow-tiff-fix-oob-read.patch diff --git a/python-Pillow-tiff-4.2.0.patch b/python-Pillow-tiff-4.2.0.patch new file mode 100644 index 0000000..6cccc6e --- /dev/null +++ b/python-Pillow-tiff-4.2.0.patch @@ -0,0 +1,14 @@ +diff --git a/src/libImaging/TiffDecode.c b/src/libImaging/TiffDecode.c +index f33cbc6bd6..d86a42915b 100644 +--- a/src/libImaging/TiffDecode.c ++++ b/src/libImaging/TiffDecode.c +@@ -578,7 +578,7 @@ int ImagingLibTiffMergeFieldInfo(ImagingCodecState state, TIFFDataType field_typ + + // custom fields added with ImagingLibTiffMergeFieldInfo are only used for + // decoding, ignore readcount; +- int readcount = 0; ++ int readcount = 1; + // we support writing a single value, or a variable number of values + int writecount = 1; + // whether the first value should encode the number of values. + diff --git a/python-Pillow-tiff-fix-oob-read.patch b/python-Pillow-tiff-fix-oob-read.patch new file mode 100644 index 0000000..4e86e77 --- /dev/null +++ b/python-Pillow-tiff-fix-oob-read.patch @@ -0,0 +1,22 @@ +diff --git a/src/libImaging/TiffDecode.c b/src/libImaging/TiffDecode.c +index bdb524bec2..f33cbc6bd6 100644 +--- a/src/libImaging/TiffDecode.c ++++ b/src/libImaging/TiffDecode.c +@@ -573,7 +573,6 @@ int ImagingLibTiffEncodeInit(ImagingCodecState state, char *filename, int fp) { + int ImagingLibTiffMergeFieldInfo(ImagingCodecState state, TIFFDataType field_type, int key, int is_var_length){ + // Refer to libtiff docs (http://www.simplesystems.org/libtiff/addingtags.html) + TIFFSTATE *clientstate = (TIFFSTATE *)state->context; +- char field_name[10]; + uint32 n; + int status = 0; + +@@ -586,7 +585,7 @@ int ImagingLibTiffMergeFieldInfo(ImagingCodecState state, TIFFDataType field_typ + int passcount = 0; + + TIFFFieldInfo info[] = { +- { key, readcount, writecount, field_type, FIELD_CUSTOM, 1, passcount, field_name } ++ { key, readcount, writecount, field_type, FIELD_CUSTOM, 1, passcount, "CustomField" } + }; + + if (is_var_length) { + diff --git a/python-Pillow.changes b/python-Pillow.changes index dee8e44..f615577 100644 --- a/python-Pillow.changes +++ b/python-Pillow.changes @@ -1,3 +1,13 @@ +------------------------------------------------------------------- +Wed Dec 30 11:04:46 UTC 2020 - pgajdos@suse.com + +- fix build with libtiff 4.2.0 +- added patches + fix https://github.com/python-pillow/Pillow/pull/5153 + + python-Pillow-tiff-4.2.0.patch + fix https://github.com/python-pillow/Pillow/commit/416f12e772d2b3cb920b18b3625e8b1419d7519e + + python-Pillow-tiff-fix-oob-read.patch + ------------------------------------------------------------------- Sun Nov 15 18:03:48 UTC 2020 - Arun Persaud diff --git a/python-Pillow.spec b/python-Pillow.spec index 5e5ec68..a59a4fb 100644 --- a/python-Pillow.spec +++ b/python-Pillow.spec @@ -26,6 +26,10 @@ Summary: Python Imaging Library (Fork) License: HPND URL: https://python-pillow.org/ Source: https://files.pythonhosted.org/packages/source/P/Pillow/Pillow-%{version}.tar.gz +# https://github.com/python-pillow/Pillow/commit/416f12e772d2b3cb920b18b3625e8b1419d7519e +Patch0: python-Pillow-tiff-fix-oob-read.patch +# https://github.com/python-pillow/Pillow/pull/5153 +Patch1: python-Pillow-tiff-4.2.0.patch BuildRequires: %{python_module devel} BuildRequires: %{python_module olefile} BuildRequires: %{python_module pytest >= 4.0} @@ -87,6 +91,8 @@ Python Imaging Library by Fredrik Lundh and Contributors. %prep %setup -q -n Pillow-%{version} +%patch0 -p1 +%patch1 -p1 %build %python_build