Changeset c5ee130


Ignore:
Timestamp:
Nov 28, 2018, 1:40:46 PM (5 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:
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.