From 7aac277ce1843676084c07365104ee5ac9210695 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Tue, 9 Aug 2011 12:53:24 +0000 Subject: Add a few asserts. git-svn-id: svn://localhost/ardour2/branches/3.0@9966 d708f5d6-7413-0410-9779-e7cbd77b26cf --- libs/ardour/sndfilesource.cc | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'libs/ardour/sndfilesource.cc') 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); -- cgit v1.2.3