summaryrefslogtreecommitdiff
path: root/libs/ardour/audioregion.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2011-10-20 19:20:22 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2011-10-20 19:20:22 +0000
commit533045aea379110f24c55427eb9d5ab4338e00cf (patch)
tree7867944ca2e7e6ab111fe1349deece60951e0611 /libs/ardour/audioregion.cc
parent3764eedca0d8ca8d666401c8bb8364705a64317e (diff)
fix an aggressive assert that crashes out when reading the wrong regions ... why are we reading the wrong regions?
git-svn-id: svn://localhost/ardour2/branches/3.0@10257 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/audioregion.cc')
-rw-r--r--libs/ardour/audioregion.cc10
1 files changed, 8 insertions, 2 deletions
diff --git a/libs/ardour/audioregion.cc b/libs/ardour/audioregion.cc
index 4e02c83ed5..5d9935935e 100644
--- a/libs/ardour/audioregion.cc
+++ b/libs/ardour/audioregion.cc
@@ -400,8 +400,14 @@ 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 */
- assert (cnt >= buf_offset);
+ before the position of this region
+ */
+ 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;