From a922126ed7495466b2193c6cf582ade11f0f8fe5 Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Mon, 13 Jan 2025 07:57:50 +1100 Subject: [PATCH] Assert fp is not None --- src/PIL/ImageFile.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/PIL/ImageFile.py b/src/PIL/ImageFile.py index f905b34b6..3476e48ff 100644 --- a/src/PIL/ImageFile.py +++ b/src/PIL/ImageFile.py @@ -180,6 +180,7 @@ class ImageFile(Image.Image): ifds.append((ifd1, exif._info.next)) offset = None + assert self.fp is not None for ifd, ifd_offset in ifds: current_offset = self.fp.tell() if offset is None: