summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2018-07-26 16:59:27 +0200
committerRobin Gareus <robin@gareus.org>2018-07-26 16:59:27 +0200
commit43c76ff23b7267ab3d78965d9ad6ce9bcc6a8b4a (patch)
treeb5e37c3d9f27731f290f9334834c902022acb26c
parent1698abc3822837aa1650c2a7cfe15722732cd05a (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.
-rw-r--r--libs/evoral/src/SMF.cpp4
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;
}