summaryrefslogtreecommitdiff
path: root/libmat2/images.py
diff options
context:
space:
mode:
authorjvoisin2019-12-15 06:57:32 -0800
committerjvoisin2019-12-15 06:57:32 -0800
commitbe24c681ffe200fdd8021e2862864d55787852f9 (patch)
tree34f92b685846cc5fa668ffa92d70d1f66dbde248 /libmat2/images.py
parentefa525c10213964c2ea6bf4e5c07b9bb058ee674 (diff)
Improve the reliability of PNG parsing
Diffstat (limited to 'libmat2/images.py')
-rw-r--r--libmat2/images.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/libmat2/images.py b/libmat2/images.py
index 18fe4d3..da42258 100644
--- a/libmat2/images.py
+++ b/libmat2/images.py
@@ -63,7 +63,8 @@ class PNGParser(exiftool.ExiftoolParser):
63 63
64 try: # better fail here than later 64 try: # better fail here than later
65 cairo.ImageSurface.create_from_png(self.filename) 65 cairo.ImageSurface.create_from_png(self.filename)
66 except MemoryError: # pragma: no cover 66 except Exception: # pragma: no cover
67 # Cairo is returning some weird exceptions :/
67 raise ValueError 68 raise ValueError
68 69
69 def remove_all(self) -> bool: 70 def remove_all(self) -> bool: