Commit de65f4f4 authored by jvoisin's avatar jvoisin
Browse files

Improve the resilience of MAT2 wrt. corrupted PNG

parent 759efa03
......@@ -62,6 +62,10 @@ class PNGParser(_ImageParser):
def __init__(self, filename):
if imghdr.what(filename) != 'png':
raise ValueError
try: # better fail here than later
except MemoryError:
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment