Some small fixes suggested by Coverity Scan

This commit is contained in:
Chris Cannam
2014-09-03 17:11:07 +01:00
parent bd7e32b34c
commit 7ad3bcd729
8 changed files with 25 additions and 8 deletions

View File

@@ -253,6 +253,12 @@ RubberBandPitchShifter::RubberBandPitchShifter(int sampleRate, size_t channels)
m_sampleRate(sampleRate),
m_channels(channels)
{
m_input = new float *[m_channels];
m_output = new float *[m_channels];
m_outputBuffer = new RingBuffer<float> *[m_channels];
m_scratch = new float *[m_channels];
for (size_t c = 0; c < m_channels; ++c) {
m_input[c] = 0;
@@ -276,6 +282,10 @@ RubberBandPitchShifter::~RubberBandPitchShifter()
delete m_outputBuffer[c];
delete[] m_scratch[c];
}
delete[] m_outputBuffer;
delete[] m_scratch;
delete[] m_output;
delete[] m_input;
}
LADSPA_Handle

View File

@@ -85,8 +85,8 @@ protected:
void updateFormant();
void updateFast();
float *m_input[2];
float *m_output[2];
float **m_input;
float **m_output;
float *m_latency;
float *m_cents;
float *m_semitones;
@@ -105,8 +105,8 @@ protected:
size_t m_minfill;
RubberBand::RubberBandStretcher *m_stretcher;
RubberBand::RingBuffer<float> *m_outputBuffer[2];
float *m_scratch[2];
RubberBand::RingBuffer<float> **m_outputBuffer;
float **m_scratch;
int m_sampleRate;
size_t m_channels;