From 43c76ff23b7267ab3d78965d9ad6ce9bcc6a8b4a Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Thu, 26 Jul 2018 16:59:27 +0200 Subject: Fix crash when testing invalid MIDI file. smf_delete() does not handle NULL pointers. This fixes a crash when checking if a MIDI source is valid. --- libs/evoral/src/SMF.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'libs/evoral') diff --git a/libs/evoral/src/SMF.cpp b/libs/evoral/src/SMF.cpp index 9bffa59805..64dd4e6889 100644 --- a/libs/evoral/src/SMF.cpp +++ b/libs/evoral/src/SMF.cpp @@ -100,7 +100,9 @@ SMF::test(const std::string& path) if (!test_smf) { return false; } - smf_delete(test_smf); + if (test_smf) { + smf_delete(test_smf); + } return true; } -- cgit v1.2.3