diff options
-rw-r--r-- | libs/ardour/audioregion.cc | 10 |
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; |