Changeset eda95c9


Ignore:
Timestamp:
Nov 24, 2018, 4:29:45 PM (5 years ago)
Author:
Paul Brossier <piem@piem.org>
Branches:
feature/autosink, feature/cnn, feature/cnn_org, feature/constantq, feature/crepe, feature/crepe_org, feature/pitchshift, feature/pydocstrings, feature/timestretch, fix/ffmpeg5, master
Children:
bcc5387
Parents:
1029ac7
Message:

[filterbank] validate input parameters

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/spectral/filterbank.c

    r1029ac7 reda95c9  
    4343  /* allocate space for filterbank object */
    4444  aubio_filterbank_t *fb = AUBIO_NEW (aubio_filterbank_t);
     45
     46  if ((sint_t)n_filters <= 0) {
     47    AUBIO_ERR("filterbank: n_filters should be > 0, got %d\n", n_filters);
     48    goto fail;
     49  }
     50  if ((sint_t)win_s <= 0) {
     51    AUBIO_ERR("filterbank: win_s should be > 0, got %d\n", win_s);
     52    goto fail;
     53  }
    4554  fb->win_s = win_s;
    4655  fb->n_filters = n_filters;
     
    5463
    5564  return fb;
     65fail:
     66  AUBIO_FREE (fb);
     67  return NULL;
    5668}
    5769
Note: See TracChangeset for help on using the changeset viewer.