Skip to content

Commit

Permalink
Code update, possible memory corruption fix
Browse files Browse the repository at this point in the history
  • Loading branch information
sadko4u committed Sep 2, 2019
1 parent 42c74f2 commit d24b14f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/core/util/Analyzer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -205,12 +205,15 @@ namespace lsp
// Limit number of samples to be processed
if (to_process > ssize_t(samples))
to_process = samples;
// Add limitation of processed data according to the FFT window size
if (to_process > ssize_t(fft_size))
to_process = fft_size;

// Move data in the buffer
dsp::move(c->vBuffer, &c->vBuffer[to_process], fft_size - to_process);
dsp::copy(&c->vBuffer[fft_size - to_process], in, to_process);

// Update counters
// Update counter and pointers
c->nCounter += to_process;
in += to_process;
samples -= to_process;
Expand Down

0 comments on commit d24b14f

Please sign in to comment.