summaryrefslogtreecommitdiff
path: root/libs/ardour/audioregion.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2011-10-20 21:24:06 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2011-10-20 21:24:06 +0000
commit8b7843917303eb1911fa0711b5908c4c0534d95a (patch)
tree4b839a5b4f90c59bfd0251f7c72ec57de91f1cf9 /libs/ardour/audioregion.cc
parentfb917cff45c95f6cdc5705d411de7cd18e466d60 (diff)
again, drop the assert when asked to read part of an audio region with an invalid timeline range, and just send an error message. this avoids crashing when loading sessions created with the broken crossfade constructor
git-svn-id: svn://localhost/ardour2/branches/3.0@10260 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/audioregion.cc')
-rw-r--r--libs/ardour/audioregion.cc13
1 files changed, 11 insertions, 2 deletions
diff --git a/libs/ardour/audioregion.cc b/libs/ardour/audioregion.cc
index e2a6694917..93c229d52f 100644
--- a/libs/ardour/audioregion.cc
+++ b/libs/ardour/audioregion.cc
@@ -400,9 +400,18 @@ AudioRegion::_read_at (const SourceList& srcs, framecnt_t limit,
internal_offset = 0;
buf_offset = _position - position;
/* if this fails then the requested section is entirely
- before the position of this region
+ before the position of this region. An error in xfade
+ construction that was fixed in oct 2011 (rev 10259)
+ led to this being the case. We don't want to crash
+ when this error is encountered, so just settle
+ on displaying an error.
*/
- assert (cnt >= buf_offset);
+ if (cnt < buf_offset) {
+ error << "trying to read region " << name() << " @ " << position << " which is outside region bounds "
+ << _position << " .. " << last_frame() << " (len = " << length() << ')'
+ << endmsg;
+ return 0; // read nothing
+ }
cnt -= buf_offset;
} else {
internal_offset = position - _position;