Changeset 99aa353


Ignore:
Timestamp:
May 2, 2016, 12:05:39 PM (8 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:
ceb884d
Parents:
8147e03
Message:

python/ext/py-phasevoc.c: add input size checks

File:
1 edited

Legend:

Unmodified
Added
Removed
  • python/ext/py-phasevoc.c

    r8147e03 r99aa353  
    103103  }
    104104
     105  if (self->vecin.length != self->hop_s) {
     106    PyErr_Format(PyExc_ValueError,
     107                 "input fvec has length %d, but pvoc expects length %d",
     108                 self->vecin.length, self->hop_s);
     109    return NULL;
     110  }
     111
    105112  Py_INCREF(self->output);
    106113  if (!PyAubio_PyCvecToCCvec (self->output, &(self->c_output))) {
     
    132139  }
    133140
     141  if (self->cvecin.length != self->win_s / 2 + 1) {
     142    PyErr_Format(PyExc_ValueError,
     143                 "input cvec has length %d, but pvoc expects length %d",
     144                 self->cvecin.length, self->win_s / 2 + 1);
     145    return NULL;
     146  }
     147
    134148  Py_INCREF(self->routput);
    135149  if (!PyAubio_ArrayToCFvec(self->routput, &(self->c_routput)) ) {
Note: See TracChangeset for help on using the changeset viewer.