ref: e9a2af140453c055aefc224169061d3436fceaa1
parent: ed6b3027eb097b8fae9bfba2f749f1ce1efb4d2e
author: Paul Brossier <piem@piem.org>
date: Thu Jan 12 17:58:01 EST 2017
src/pitch/pitchfcomb.c: return NULL if fft creation failed
--- a/src/pitch/pitchfcomb.c
+++ b/src/pitch/pitchfcomb.c
@@ -53,12 +53,17 @@
aubio_pitchfcomb_t *p = AUBIO_NEW (aubio_pitchfcomb_t);
p->fftSize = bufsize;
p->stepSize = hopsize;
+ p->fft = new_aubio_fft (bufsize);
+ if (!p->fft) goto beach;
p->winput = new_fvec (bufsize);
p->fftOut = new_cvec (bufsize);
p->fftLastPhase = new_fvec (bufsize);
- p->fft = new_aubio_fft (bufsize);
p->win = new_aubio_window ("hanning", bufsize);
return p;
+
+beach:
+ AUBIO_FREE(p);
+ return NULL;
}
/* input must be stepsize long */