From f160e698a1e650a06f2287821be8d95be0fbb0c2 Mon Sep 17 00:00:00 2001 From: Dawid Crivelli Date: Mon, 20 Jun 2022 16:20:08 +0200 Subject: [PATCH] Handle PCF fonts files with missing characters --- src/PIL/PcfFontFile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/PIL/PcfFontFile.py b/src/PIL/PcfFontFile.py index 0556c2bbc..686237c12 100644 --- a/src/PIL/PcfFontFile.py +++ b/src/PIL/PcfFontFile.py @@ -241,7 +241,7 @@ class PcfFontFile(FontFile.FontFile): ] if encoding_offset != 0xFFFF: encoding[i] = encoding_offset - except UnicodeDecodeError: + except (UnicodeDecodeError, IndexError): # character is not supported in selected encoding pass