Skip to content

Commit

Permalink
Merge pull request #3923 from cgohlke/patch-1
Browse files Browse the repository at this point in the history
Use unsigned int to store TIFF IFD offsets
  • Loading branch information
hugovk committed Jun 29, 2019
2 parents d19ed25 + 59e1328 commit af0d90a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/decode.c
Expand Up @@ -503,9 +503,9 @@ PyImaging_LibTiffDecoderNew(PyObject* self, PyObject* args)
char* rawmode;
char* compname;
int fp;
int ifdoffset;
uint32 ifdoffset;

if (! PyArg_ParseTuple(args, "sssii", &mode, &rawmode, &compname, &fp, &ifdoffset))
if (! PyArg_ParseTuple(args, "sssiI", &mode, &rawmode, &compname, &fp, &ifdoffset))
return NULL;

TRACE(("new tiff decoder %s\n", compname));
Expand Down
2 changes: 1 addition & 1 deletion src/libImaging/TiffDecode.c
Expand Up @@ -147,7 +147,7 @@ void _tiffUnmapProc(thandle_t hdata, tdata_t base, toff_t size) {
(void) hdata; (void) base; (void) size;
}

int ImagingLibTiffInit(ImagingCodecState state, int fp, int offset) {
int ImagingLibTiffInit(ImagingCodecState state, int fp, uint32 offset) {
TIFFSTATE *clientstate = (TIFFSTATE *)state->context;

TRACE(("initing libtiff\n"));
Expand Down
2 changes: 1 addition & 1 deletion src/libImaging/TiffDecode.h
Expand Up @@ -43,7 +43,7 @@ typedef struct {



extern int ImagingLibTiffInit(ImagingCodecState state, int fp, int offset);
extern int ImagingLibTiffInit(ImagingCodecState state, int fp, uint32 offset);
extern int ImagingLibTiffEncodeInit(ImagingCodecState state, char *filename, int fp);
extern int ImagingLibTiffMergeFieldInfo(ImagingCodecState state, TIFFDataType field_type, int key);
extern int ImagingLibTiffSetField(ImagingCodecState state, ttag_t tag, ...);
Expand Down

0 comments on commit af0d90a

Please sign in to comment.