Changeset f73f3fb


Ignore:
Timestamp:
Nov 28, 2018, 3:27:08 PM (6 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:
7625d85
Parents:
c5ee130
Message:

[pitch] prevent null pointer dereference in yinfast

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/pitch/pitchyinfast.c

    rc5ee130 rf73f3fb  
    5959  o->kernel_fft = new_fvec (bufsize);
    6060  o->fft = new_aubio_fft (bufsize);
     61  if (!o->yin || !o->tmpdata || !o->tmpdata || !o->sqdiff
     62      || !o->kernel || !o->samples_fft || !o->kernel || !o->fft)
     63  {
     64    del_aubio_pitchyinfast(o);
     65    return NULL;
     66  }
    6167  o->tol = 0.15;
    6268  o->peak_pos = 0;
     
    6773del_aubio_pitchyinfast (aubio_pitchyinfast_t * o)
    6874{
    69   del_fvec (o->yin);
    70   del_fvec (o->tmpdata);
    71   del_fvec (o->sqdiff);
    72   del_fvec (o->kernel);
    73   del_fvec (o->samples_fft);
    74   del_fvec (o->kernel_fft);
    75   del_aubio_fft (o->fft);
     75  if (o->yin)
     76    del_fvec (o->yin);
     77  if (o->tmpdata)
     78    del_fvec (o->tmpdata);
     79  if (o->sqdiff)
     80    del_fvec (o->sqdiff);
     81  if (o->kernel)
     82    del_fvec (o->kernel);
     83  if (o->samples_fft)
     84    del_fvec (o->samples_fft);
     85  if (o->kernel_fft)
     86    del_fvec (o->kernel_fft);
     87  if (o->fft)
     88    del_aubio_fft (o->fft);
    7689  AUBIO_FREE (o);
    7790}
Note: See TracChangeset for help on using the changeset viewer.