From: Robin Gareus Date: Thu, 26 Jul 2018 14:59:27 +0000 (+0200) Subject: Fix crash when testing invalid MIDI file. X-Git-Url: https://main.carlh.net/gitweb/?a=commitdiff_plain;h=43c76ff23b7267ab3d78965d9ad6ce9bcc6a8b4a;p=ardour.git 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. --- 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; }