Mentions légales du service

Skip to content
Snippets Groups Projects
Commit cd32e939 authored by hhakim's avatar hhakim
Browse files

Check that FaustCorePy.get_fact() index argument is in correct range.

parent aac41383
No related branches found
No related tags found
No related merge requests found
...@@ -185,6 +185,9 @@ cdef class FaustCore: ...@@ -185,6 +185,9 @@ cdef class FaustCore:
return nb_factors return nb_factors
def get_fact(self,i): def get_fact(self,i):
if(i >= self.get_nb_factors() or i < 0):
raise ValueError("factor index must be greater or equal 0 and "
"lower than "+str(self.get_nb_factors())+".")
cdef fact = np.zeros([self.m_faust.get_fact_nb_rows(i), cdef fact = np.zeros([self.m_faust.get_fact_nb_rows(i),
self.m_faust.get_fact_nb_cols(i)], dtype='d', self.m_faust.get_fact_nb_cols(i)], dtype='d',
order='F') order='F')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment