ref: 078dad8f5b3484f070d1db29e97aba11c5613f65
parent: 0ff1b403a729a53f78f277940d4a2e715fe3c841
author: Paul Brossier <piem@piem.org>
date: Wed Sep 28 11:10:25 EDT 2016
src/onset/onset.c: return null and clean-up if new_aubio_specdesc failed
--- a/src/onset/onset.c
+++ b/src/onset/onset.c
@@ -205,6 +205,7 @@
o->pv = new_aubio_pvoc(buf_size, o->hop_size);
o->pp = new_aubio_peakpicker();
o->od = new_aubio_specdesc(onset_mode,buf_size);
+ if (o->od == NULL) goto beach_specdesc;
o->fftgrain = new_cvec(buf_size);
o->desc = new_fvec(1);
@@ -219,6 +220,9 @@
o->total_frames = 0;
return o;
+beach_specdesc:
+ del_aubio_peakpicker(o->pp);
+ del_aubio_pvoc(o->pv);
beach:
AUBIO_FREE(o);
return NULL;