From 4fd47182f2bf2e1a88b5f2f1c880e592addb1bc9 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Thu, 11 Feb 2016 23:12:20 +0100 Subject: [PATCH] Help clang static analyzer. --- libs/ardour/mtdm.cc | 2 ++ libs/audiographer/src/general/analyser.cc | 1 + 2 files changed, 3 insertions(+) diff --git a/libs/ardour/mtdm.cc b/libs/ardour/mtdm.cc index 46cf90898a..f959d30539 100644 --- a/libs/ardour/mtdm.cc +++ b/libs/ardour/mtdm.cc @@ -17,6 +17,7 @@ */ #include +#include #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--) { diff --git a/libs/audiographer/src/general/analyser.cc b/libs/audiographer/src/general/analyser.cc index 833fbcb2f9..23c85e8a7c 100644 --- a/libs/audiographer/src/general/analyser.cc +++ b/libs/audiographer/src/general/analyser.cc @@ -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;