projects
/
ardour.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2e92ae9
)
More potential SMF crash fixes.
author
David Robillard
<d@drobilla.net>
Sat, 6 Dec 2014 16:19:48 +0000
(11:19 -0500)
committer
David Robillard
<d@drobilla.net>
Sat, 6 Dec 2014 16:19:48 +0000
(11:19 -0500)
libs/evoral/src/SMF.cpp
patch
|
blob
|
history
diff --git
a/libs/evoral/src/SMF.cpp
b/libs/evoral/src/SMF.cpp
index b75141d7fb9ce1f58a3f2d823bbecd1e33625fc4..78800923cae8c88ff727a50b21d5eda6255a3f36 100644
(file)
--- a/
libs/evoral/src/SMF.cpp
+++ b/
libs/evoral/src/SMF.cpp
@@
-44,7
+44,7
@@
uint16_t
SMF::num_tracks() const
{
Glib::Threads::Mutex::Lock lm (_smf_lock);
- return _smf
->number_of_tracks
;
+ return _smf
? _smf->number_of_tracks : 0
;
}
uint16_t
@@
-167,7
+167,9
@@
SMF::create(const std::string& path, int track, uint16_t ppqn) THROW_FILE_ERROR
for (int i = 0; i < track; ++i) {
_smf_track = smf_track_new();
- assert(_smf_track);
+ if (!_smf_track) {
+ return -2;
+ }
smf_add_track(_smf, _smf_track);
}