From 4d7b630b33c58e215ea9938bb1df26d745f73523 Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Wed, 18 Nov 2015 01:18:01 +1100 Subject: [PATCH] Catch OverflowError in SpiderImagePlugin --- PIL/SpiderImagePlugin.py | 2 ++ Tests/images/invalid.spider | Bin 0 -> 167 bytes Tests/test_file_spider.py | 5 +++++ 3 files changed, 7 insertions(+) create mode 100644 Tests/images/invalid.spider diff --git a/PIL/SpiderImagePlugin.py b/PIL/SpiderImagePlugin.py index 6344a1540..0ce63002b 100644 --- a/PIL/SpiderImagePlugin.py +++ b/PIL/SpiderImagePlugin.py @@ -50,6 +50,8 @@ def isInt(f): return 0 except ValueError: return 0 + except OverflowError: + return 0 iforms = [1, 3, -11, -12, -21, -22] diff --git a/Tests/images/invalid.spider b/Tests/images/invalid.spider new file mode 100644 index 0000000000000000000000000000000000000000..c6b024d6ebe7a46afc35468a71577345dbbd34bb GIT binary patch literal 167 zcmez0z`(#D#KjCG=ZB=H04Y%*cKHAQ$$u~aa%TQNlXm8e@ys-ajFofzf*DquPv0H^ zl1%b;cVXyYRr3HU;w