Changeset 767990e


Ignore:
Timestamp:
Nov 28, 2013, 9:51:15 PM (11 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, pitchshift, sampler, timestretch, yinfft+
Children:
83d2948
Parents:
41eff53
Message:

src/{fvec,cvec,lvec,fmat}.c: make sure new_ functions return NULL if length <= 0

Location:
src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • src/cvec.c

    r41eff53 r767990e  
    2323
    2424cvec_t * new_cvec( uint_t length) {
     25  if ((sint_t)length <= 0) {
     26    return NULL;
     27  }
    2528  cvec_t * s = AUBIO_NEW(cvec_t);
    2629  s->length = length/2 + 1;
  • src/fmat.c

    r41eff53 r767990e  
    2323
    2424fmat_t * new_fmat (uint_t length, uint_t height) {
     25  if ((sint_t)length <= 0 || (sint_t)height <= 0 ) {
     26    return NULL;
     27  }
    2528  fmat_t * s = AUBIO_NEW(fmat_t);
    2629  uint_t i,j;
  • src/fvec.c

    r41eff53 r767990e  
    2323
    2424fvec_t * new_fvec( uint_t length) {
     25  if ((sint_t)length <= 0) {
     26    return NULL;
     27  }
    2528  fvec_t * s = AUBIO_NEW(fvec_t);
    2629  s->length = length;
  • src/lvec.c

    r41eff53 r767990e  
    2323
    2424lvec_t * new_lvec( uint_t length) {
     25  if ((sint_t)length <= 0) {
     26    return NULL;
     27  }
    2528  lvec_t * s = AUBIO_NEW(lvec_t);
    2629  s->length = length;
Note: See TracChangeset for help on using the changeset viewer.