From e312868c4edab227b772f4795e8adff96da4bf4d Mon Sep 17 00:00:00 2001 From: jvoisin Date: Mon, 13 Dec 2021 19:00:41 +0100 Subject: Increase a bit the robustness of mat2 Those issues were found via https://github.com/google/atheris --- libmat2/audio.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'libmat2/audio.py') diff --git a/libmat2/audio.py b/libmat2/audio.py index bd7add9..3f3a757 100644 --- a/libmat2/audio.py +++ b/libmat2/audio.py @@ -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 -- cgit v1.3