Changeset c5ee130 for src


Ignore:
Timestamp:
Nov 28, 2018, 1:40:46 PM (12 months ago)
Author:
Paul Brossier <piem@piem.org>
Branches:
feature/autosink, feature/constantq, feature/pitchshift, feature/pydocstrings, feature/timestretch, master
Children:
f73f3fb
Parents:
4506b0c
Message:

[notes] prevent null pointer dereference

thanks to @niugx

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/notes/notes.c

    r4506b0c rc5ee130  
    8484
    8585  o->onset = new_aubio_onset (onset_method, o->onset_buf_size, o->hop_size, o->samplerate);
     86  if (o->onset == NULL) goto fail;
    8687  if (o->onset_threshold != 0.) aubio_onset_set_threshold (o->onset, o->onset_threshold);
    8788  o->onset_output = new_fvec (1);
     
    99100  o->note_buffer = new_fvec(o->median);
    100101  o->note_buffer2 = new_fvec(o->median);
     102
     103  if (!o->onset_output || !o->pitch_output ||
     104      !o->note_buffer || !o->note_buffer2) goto fail;
    101105
    102106  o->curnote = -1.;
Note: See TracChangeset for help on using the changeset viewer.