check nb_samples

dev
xufulong 3 years ago
parent 1f17e2f961
commit efd979b8fa
  1. 5
      app/src/main/cpp/visualizer/execute_fft.cpp

@ -228,7 +228,10 @@ void release_visualizer(filter_sys_t *p_filter)
}
int ensure_memory(filter_sys_t *fft_filter, int nb_samples) {
if (nb_samples != fft_filter->nb_samples && nb_samples >= MIN_FFT_SIZE) {
if (nb_samples < MIN_FFT_SIZE) {
return -1;
}
if (nb_samples != fft_filter->nb_samples) {
if (!fft_filter->data) {
fft_filter->data_size = nb_samples;
fft_filter->data = (uint8_t *) (malloc(nb_samples * sizeof(uint8_t)));

Loading…
Cancel
Save