Skip to content
Snippets Groups Projects
Commit e312868c authored by Julien (jvoisin) Voisin's avatar Julien (jvoisin) Voisin
Browse files

Increase a bit the robustness of mat2

Those issues were found via https://github.com/google/atheris
parent b71bafd2
No related branches found
No related tags found
No related merge requests found
Pipeline #71000 passed with warnings
......@@ -13,7 +13,8 @@ class MutagenParser(abstract.AbstractParser):
def __init__(self, filename):
super().__init__(filename)
try:
mutagen.File(self.filename)
if mutagen.File(self.filename) is None:
raise ValueError
except mutagen.MutagenError:
raise ValueError
......
......@@ -26,7 +26,10 @@ class SVGParser(exiftool.ExiftoolParser):
}
def remove_all(self) -> bool:
svg = Rsvg.Handle.new_from_file(self.filename)
try:
svg = Rsvg.Handle.new_from_file(self.filename)
except GLib.GError:
raise ValueError
dimensions = svg.get_dimensions()
surface = cairo.SVGSurface(self.output_filename,
dimensions.height,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment