From 93805d5257add6439c62992d83f691df9be8c5e6 Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Mon, 27 Jun 2022 14:03:20 +1000 Subject: [PATCH] Limit expected number of characters to nencoding --- .../fonts/10x20-ISO8859-1-fewer-characters.pcf | Bin 0 -> 25860 bytes Tests/test_font_pcf.py | 8 ++++++++ src/PIL/PcfFontFile.py | 12 ++++-------- 3 files changed, 12 insertions(+), 8 deletions(-) create mode 100644 Tests/fonts/10x20-ISO8859-1-fewer-characters.pcf diff --git a/Tests/fonts/10x20-ISO8859-1-fewer-characters.pcf b/Tests/fonts/10x20-ISO8859-1-fewer-characters.pcf new file mode 100644 index 0000000000000000000000000000000000000000..c065f59a9daca445b77e06a43daa7a0cdf645b62 GIT binary patch literal 25860 zcmeI5e{@^rdB-352Psg%6lj4!BPc%x)IlK$3BM96u@k%|wux;Zu+>sz*;bJyMY57O zkmM#YP2v!6*R`d;R@1IqyRNIdvLB^Crmbr`wyyO?**ew^?`&tM`(tNj=WJ_xPM3YZ z_ufZ-b0b|zmMQ<_IehfK_kExDd7t-rpL=yBnVY~+EOWky1i;1Mc!S8ZC{f78XdFZt zY!qqIV^k(^{3afQ_D+!>FB54o`rr8g#<=}0Ff`RK(&ip>?DRt-mV5jxCcoiP9AGY; z@2i-Uwjpoh3w?VFxQvzMAjrx)!5yq@03EEn3v6eF_I9zd8)Si84i2#L7vMN6RQ`Zg zK1t=@0l&)@OfN66<*&d?to$qZH()ROKUuj5{0v=zCU7e&>p(Xvec);8T!4x_#V{(< zZi@syx23zQuPeO0V_-+e*3RC(9Xmy~boY0)qq04bi^-Po_ReiP2dE-j68qwV@=!w*J1(?yiA{#W>h0y*=U0on2dHvxFb)*b&~^F<{Rjo9_?r zz=R8qclLI#U%&RQVn;{U=I(ZmTqO?=+;4j=o5MZDYIo1h9bAg^LbyNG6j`o4ht}WftF_;*O4+i%p#zum}y9S3) zU$t`eO2iIO`Zp^^Oq!3$?CW%l|gFu0q{)ymgfuTVwt5K!3R1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