diff options
| author | jvoisin | 2021-12-13 19:00:41 +0100 |
|---|---|---|
| committer | jvoisin | 2021-12-13 19:00:41 +0100 |
| commit | e312868c4edab227b772f4795e8adff96da4bf4d (patch) | |
| tree | 734340fd47f0f15d43404bc8a3a48f4b3390af57 /libmat2/images.py | |
| parent | b71bafd2cfaec838844447676f9fae30abe432ef (diff) | |
Increase a bit the robustness of mat2
Those issues were found via https://github.com/google/atheris
Diffstat (limited to 'libmat2/images.py')
| -rw-r--r-- | libmat2/images.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/libmat2/images.py b/libmat2/images.py index e55b765..c584c1c 100644 --- a/libmat2/images.py +++ b/libmat2/images.py | |||
| @@ -26,7 +26,10 @@ class SVGParser(exiftool.ExiftoolParser): | |||
| 26 | } | 26 | } |
| 27 | 27 | ||
| 28 | def remove_all(self) -> bool: | 28 | def remove_all(self) -> bool: |
| 29 | svg = Rsvg.Handle.new_from_file(self.filename) | 29 | try: |
| 30 | svg = Rsvg.Handle.new_from_file(self.filename) | ||
| 31 | except GLib.GError: | ||
| 32 | raise ValueError | ||
| 30 | dimensions = svg.get_dimensions() | 33 | dimensions = svg.get_dimensions() |
| 31 | surface = cairo.SVGSurface(self.output_filename, | 34 | surface = cairo.SVGSurface(self.output_filename, |
| 32 | dimensions.height, | 35 | dimensions.height, |
