From 6b21a96578442cb0a4a806eb0b7f9de6682fcd04 Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Wed, 30 Dec 2020 11:57:05 +1100 Subject: [PATCH] Changed readcount so that _TIFFSetGetType can identify the type --- src/libImaging/TiffDecode.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libImaging/TiffDecode.c b/src/libImaging/TiffDecode.c index f33cbc6bd..d86a42915 100644 --- a/src/libImaging/TiffDecode.c +++ b/src/libImaging/TiffDecode.c @@ -378,7 +378,7 @@ int ImagingLibTiffDecode(Imaging im, ImagingCodecState state, UINT8* buffer, Py_ TIFFClose(tiff); return -1; } - + state->bytes = row_byte_size * tile_length; if (TIFFTileSize(tiff) > state->bytes) { @@ -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.