Changeset 99aa353


Ignore:
Timestamp:
May 2, 2016, 12:05:39 PM (4 years ago)
Author:
Paul Brossier <piem@piem.org>
Branches:
feature/autosink, feature/constantq, feature/pitchshift, feature/pydocstrings, feature/timestretch, 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.