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 416f12e772
  + 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
This commit is contained in:
Matej Cepl 2020-12-30 14:03:15 +00:00 committed by Git OBS Bridge
parent 902382c33f
commit 5d7ef421df
4 changed files with 52 additions and 0 deletions

View File

@ -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.

View File

@ -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) {

View File

@ -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 <arun@gmx.de>

View File

@ -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