Fix a spurious assert() failure.
authorCarl Hetherington <cth@carlh.net>
Fri, 2 May 2014 12:51:03 +0000 (13:51 +0100)
committerCarl Hetherington <cth@carlh.net>
Fri, 2 May 2014 12:51:03 +0000 (13:51 +0100)
src/lib/audio_buffers.cc

index 99e52d92ae0f7bea78e0356a05103fb8e43f65ce..4ada94db867b59d4fe7425fc6b048e0a251ae721 100644 (file)
@@ -175,6 +175,11 @@ AudioBuffers::make_silent (int from, int frames)
 void
 AudioBuffers::copy_from (AudioBuffers const * from, int frames_to_copy, int read_offset, int write_offset)
 {
+       if (frames_to_copy == 0) {
+               /* Prevent the asserts from firing if there is nothing to do */
+               return;
+       }
+       
        assert (from->channels() == channels());
 
        assert (from);