We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5ad98e7 commit 34762deCopy full SHA for 34762de
src/PIL/ImageFile.py
@@ -191,7 +191,10 @@ def get_child_images(self) -> list[ImageFile]:
191
if thumbnail_offset is not None:
192
thumbnail_offset += getattr(self, "_exif_offset", 0)
193
self.fp.seek(thumbnail_offset)
194
- data = self.fp.read(ifd.get(ExifTags.Base.JpegIFByteCount))
+
195
+ length = ifd.get(ExifTags.Base.JpegIFByteCount)
196
+ assert isinstance(length, int)
197
+ data = self.fp.read(length)
198
fp = io.BytesIO(data)
199
200
with Image.open(fp) as im:
0 commit comments