diff options
Diffstat (limited to 'libs/ardour/sndfilesource.cc')
-rw-r--r-- | libs/ardour/sndfilesource.cc | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libs/ardour/sndfilesource.cc b/libs/ardour/sndfilesource.cc index e5ba83015d..47571cead6 100644 --- a/libs/ardour/sndfilesource.cc +++ b/libs/ardour/sndfilesource.cc @@ -269,6 +269,8 @@ SndFileSource::sample_rate () const framecnt_t SndFileSource::read_unlocked (Sample *dst, framepos_t start, framecnt_t cnt) const { + assert (cnt >= 0); + int32_t nread; float *ptr; uint32_t real_cnt; @@ -306,6 +308,8 @@ SndFileSource::read_unlocked (Sample *dst, framepos_t start, framecnt_t cnt) con file_cnt = cnt; } + assert (file_cnt >= 0); + if (file_cnt != cnt) { framepos_t delta = cnt - file_cnt; memset (dst+file_cnt, 0, sizeof (Sample) * delta); |