ref: 0f2c1f43182106c63ed499de2c04d2b47788cf97
parent: 1160f113153dba190f40f09aa0442798e75774da
author: Paul Brossier <piem@piem.org>
date: Thu Jan 12 17:58:33 EST 2017
src/pitch/pitchyinfft.c: return NULL if fft creation failed
--- a/src/pitch/pitchyinfft.c
+++ b/src/pitch/pitchyinfft.c
@@ -62,6 +62,7 @@
aubio_pitchyinfft_t *p = AUBIO_NEW (aubio_pitchyinfft_t);
p->winput = new_fvec (bufsize);
p->fft = new_aubio_fft (bufsize);
+ if (!p->fft) goto beach;
p->fftout = new_fvec (bufsize);
p->sqrmag = new_fvec (bufsize);
p->yinfft = new_fvec (bufsize / 2 + 1);
@@ -95,6 +96,11 @@
// check for octave errors above 1300 Hz
p->short_period = (uint_t)ROUND(samplerate / 1300.);
return p;
+
+beach:
+ if (p->winput) del_fvec(p->winput);
+ AUBIO_FREE(p);
+ return NULL;
}
void