Help clang static analyzer.
authorRobin Gareus <robin@gareus.org>
Thu, 11 Feb 2016 22:12:20 +0000 (23:12 +0100)
committerRobin Gareus <robin@gareus.org>
Thu, 11 Feb 2016 22:12:20 +0000 (23:12 +0100)
libs/ardour/mtdm.cc
libs/audiographer/src/general/analyser.cc

index 46cf90898a9810f428ab491f72409a521e4db224..f959d30539d752da322f86138d2f1e4415634f2c 100644 (file)
@@ -17,6 +17,7 @@
 */
 
 #include <math.h>
+#include <assert.h>
 
 #include "ardour/mtdm.h"
 
@@ -58,6 +59,7 @@ int MTDM::process (size_t len, float *ip, float *op)
     float  vip, vop, a, c, s;
     Freq   *F;
                float peak = 0;
+               assert (len > 0);
 
     while (len--)
     {
index 833fbcb2f978a97cf9415b4ccf20828b81de8cd9..23c85e8a7c7b912057cd25963334d3dfcad7cbdc 100644 (file)
@@ -31,6 +31,7 @@ Analyser::Analyser (float sample_rate, unsigned int channels, framecnt_t bufsize
        , _pos (0)
 {
        assert (bufsize % channels == 0);
+       assert (bufsize > 1);
        //printf ("NEW ANALYSER %p r:%.1f c:%d f:%ld l%ld\n", this, sample_rate, channels, bufsize, n_samples);
        if (channels > 0 && channels <= 2) {
                using namespace Vamp::HostExt;