diff options
author | Robin Gareus <robin@gareus.org> | 2018-07-26 16:59:27 +0200 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2018-07-26 16:59:27 +0200 |
commit | 43c76ff23b7267ab3d78965d9ad6ce9bcc6a8b4a (patch) | |
tree | b5e37c3d9f27731f290f9334834c902022acb26c /libs/evoral | |
parent | 1698abc3822837aa1650c2a7cfe15722732cd05a (diff) |
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.
Diffstat (limited to 'libs/evoral')
-rw-r--r-- | libs/evoral/src/SMF.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
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; } |