From bd5cf7db87c6abf7c3510a50170851af5538249f Mon Sep 17 00:00:00 2001 From: Eric Soroos Date: Sun, 8 Aug 2021 14:04:05 +0200 Subject: [PATCH] FLI tests for Oss-fuzz crash. * Note, valgrind doesn't pick this up, it's only the oss-fuzz reproducer that catches it OMM. --- Tests/images/crash-5762152299364352.fli | Bin 0 -> 8731 bytes Tests/test_file_fli.py | 13 +++++++++++++ 2 files changed, 13 insertions(+) create mode 100644 Tests/images/crash-5762152299364352.fli diff --git a/Tests/images/crash-5762152299364352.fli b/Tests/images/crash-5762152299364352.fli new file mode 100644 index 0000000000000000000000000000000000000000..944fe0b56c73b016c7599beb5b8e47cd33f0432f GIT binary patch literal 8731 zcmeGhe{2)y^_}g@4`aKIaSJo+dW4`dO##PA)8G+^?Zm_^!LIE5d?6(%)mHwLLHc48!QEj&Uk96VA=NgRotsN z3st@w0QmPMlg@I2)eK+(2EgWD3Q%8Xx7E39wvF|*_3JzDbJ^^6L{F{tK9_yH$L@AH zJfA~DO{%~Tqm{X&XYPP=eEYwC)*$72tiig~!?mBDEi&ai`4Ht;69`6HJ3nC*I- z4fL_crrA>qU+vb=I5dJmt^ACOO=j1|O)I@a`Bp*$0K=GRowXfjLYnrO0~uzd30TA$ zU5EC^y*f>L9){KW{s-wzI$eW(KaVFTjS4picl|-1 zI0oUm=J4XLX5YQ84mYeU9L9Zg4!bu=rJRWL$4I+#LaK=8f{pmM`HYB1!eMPRLjdGg zNY{adap8%JoJh~0Kt@RmTx?iTmEy3H=RzUQ z=WThI+t#1rMVXji1Y-ETt^Sr)&euwWcPCE5Gy`T~>}TgMjGZ`fa>MMIAD@hl?4A0< zTmPJVw(-vga(}5NS%LB6~xB6axFaGP_MSl_d&gA5YiOAMH z<##V1KRR{vwXxa1OeCfYyUyMJ0S|!}e;fp0C$u0%P#ICIpeRELK`rH@>Bo6w+w^Vqi&!;ELClKP)dB@g$nRXWRrKMt3vOlYiR2w}xsk_?1S=Ww9v7Q1I>J?jcG2@D*4SC~kS&2370JrQ~6r8V8 zxAgvxXkGR5!zno{WI7vnH162V?b=bu4EYnn6GV>Y^8Nk(Ua^Qr*_a{g7K(g9)B-w# z74Hsf>VE8y6V%jh?)Jf++xMuIo}~H9H5a;P3|?!88@?Y`k0aiMuyM`rFdFyB!0~fiIPx04Q{9I zo|<=ZRF;!x0S;i4cJMiXM=t|>bpYV8*8!eF;WrVVM*J4yF`cG1$*3lzK#yX{QN$4l z5CDu}0~1ylvjcw01B@e*F)~E;I3gLO+Grm|+K>}XGDGJZNFPCb5|Q+e0G;EK$Q9L| z5!IjK=>xp8v6vbWGL1S@l#6Og=7mUiXCt26+eI0f~GrVj1 z(l`-=wc#H*FHLQD@Bw^P&k&#N!`gz_r6X1d41T>c-+ty<`r`ljP$obr7Gj0%Kpd&hD@~9S*14;c&RAaJVa7 z8uXr31F3mf&S3czG}J*a^qQGQFf}md2B!Q0j*KmzX7=EKSW2KW3=Iweli?-{TT@$C zZ(WB8!No!bOlCvq1jfRcO%@YdTT{oHZ5=3VFk3deTG+rNsr8Ld9P`zsvuOdGhe_*=~)OZfp#~6ayNmpcJixMutJhNV)z2c}5L8KJqS2Bqn&N zl1PkU;Kz3z((Yy|oP0saAH09F0TLp literal 0 HcmV?d00001 diff --git a/Tests/test_file_fli.py b/Tests/test_file_fli.py index 1c1abf2b175..675e06bf83c 100644 --- a/Tests/test_file_fli.py +++ b/Tests/test_file_fli.py @@ -138,3 +138,16 @@ def test_timeouts(test_file): with Image.open(f) as im: with pytest.raises(OSError): im.load() + + +@pytest.mark.parametrize( + "test_file", + [ + "Tests/images/crash-5762152299364352.fli", + ], +) +def test_crash(test_file): + with open(test_file, "rb") as f: + with Image.open(f) as im: + with pytest.raises(OSError): + im.load()