fix unpack to c_ssize_t on 32 bit systems with corrupt EXIF data

This commit is contained in:
paddywwoof 2019-07-30 18:06:43 +01:00
parent f3f45cfec5
commit 9c7d3a0e4a

View File

@ -771,7 +771,12 @@ class ImageFileDirectory_v2(MutableMapping):
"Tag Location: %s - Data Location: %s" % (here, offset),
end=" ",
)
try:
fp.seek(offset)
except OverflowError as e:
if DEBUG:
print("- offset value wrong. Possibly corrupt EXIF data. ", e)
continue # ignore corrupt EXIF data
data = ImageFile._safe_read(fp, size)
fp.seek(here)
else: