13
0

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.
This commit is contained in:
Robin Gareus 2018-07-26 16:59:27 +02:00
parent 1698abc382
commit 43c76ff23b

View File

@ -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;
}