summaryrefslogtreecommitdiff
path: root/libs
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2008-05-16 02:35:37 +0000
committerDavid Robillard <d@drobilla.net>2008-05-16 02:35:37 +0000
commit722b85e828c55eed97754f50e445a14935effb65 (patch)
tree9ce4af0a6db56334d8a2566e46deec201c9b46f0 /libs
parent504a3d765f3d67b2b2053ac02e8d2fcb38e34f7e (diff)
Fix crash on out of range MIDI events (though this shouldn't be possible at all....).
git-svn-id: svn://localhost/ardour2/branches/3.0@3357 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs')
-rw-r--r--libs/ardour/midi_model.cc8
1 files changed, 6 insertions, 2 deletions
diff --git a/libs/ardour/midi_model.cc b/libs/ardour/midi_model.cc
index b4e2c54d3c..8819423694 100644
--- a/libs/ardour/midi_model.cc
+++ b/libs/ardour/midi_model.cc
@@ -101,8 +101,12 @@ MidiModel::const_iterator::const_iterator(const MidiModel& model, double t)
}
assert(x >= 0);
- assert(y >= i->first.min());
- assert(y <= i->first.max());
+
+ if (y >= i->first.min() || y <= i->first.max()) {
+ cerr << "ERROR: Event value '" << y << "' out of range ["
+ << i->first.min() << "," << i->first.max() << "], ignored" << endl;
+ continue;
+ }
const MidiControlIterator new_iter(i->second->list(), x, y);