From b74b101a45833383d950f572a681152ecc48949b Mon Sep 17 00:00:00 2001 From: stalkerg Date: Fri, 11 Dec 2020 18:26:20 +0900 Subject: [PATCH] fix open JPEG file if wrong or unknow 8BIM tag --- src/PIL/JpegImagePlugin.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/PIL/JpegImagePlugin.py b/src/PIL/JpegImagePlugin.py index 29bc61aa8..1ed21f046 100644 --- a/src/PIL/JpegImagePlugin.py +++ b/src/PIL/JpegImagePlugin.py @@ -133,7 +133,7 @@ def APP(self, marker): photoshop[code] = data offset += size offset += offset & 1 # align - except struct.error: + except (struct.error, IndexError): break # insufficient data elif marker == 0xFFEE and s[:5] == b"Adobe":