aboutsummaryrefslogtreecommitdiff
path: root/nusmuk-utils
diff options
context:
space:
mode:
authorCyrille Henry <nusmuk@users.sourceforge.net>2015-02-04 16:40:58 +0000
committerCyrille Henry <nusmuk@users.sourceforge.net>2015-02-04 16:40:58 +0000
commit3fe508ed633583fff7e62f7941b03f36cb771678 (patch)
treee3773d612cd1a9210560b150634af149881cd85f /nusmuk-utils
parent4b2f71090cc3e29ac4e70c69b5b59d9870305ca6 (diff)
debug crash when factor=0
svn path=/trunk/externals/nusmuk/; revision=17423
Diffstat (limited to 'nusmuk-utils')
-rw-r--r--nusmuk-utils/tab_upsample.c2
-rw-r--r--nusmuk-utils/tab_upsample_copy.c2
2 files changed, 3 insertions, 1 deletions
diff --git a/nusmuk-utils/tab_upsample.c b/nusmuk-utils/tab_upsample.c
index 36d2188..bb32d6e 100644
--- a/nusmuk-utils/tab_upsample.c
+++ b/nusmuk-utils/tab_upsample.c
@@ -36,6 +36,8 @@ void tab_upsample_compute(t_tab_upsample *x)
int nb_max, i, index_dst;
+ x->factor = MAX(x->factor, 1);
+
if (!(a_src = (t_garray *)pd_findbyclass(x->x_arrayname_src, garray_class)))
pd_error(x, "%s: no such array", x->x_arrayname_src->s_name);
else if (!garray_getfloatwords(a_src, &npoints_src, &vec_src))
diff --git a/nusmuk-utils/tab_upsample_copy.c b/nusmuk-utils/tab_upsample_copy.c
index 5b5687b..c123896 100644
--- a/nusmuk-utils/tab_upsample_copy.c
+++ b/nusmuk-utils/tab_upsample_copy.c
@@ -35,7 +35,7 @@ void tab_upsample_copy_compute(t_tab_upsample_copy *x)
t_word *vec_src, *vec_dst;
int nb_max, i, j;
-
+
if (!(a_src = (t_garray *)pd_findbyclass(x->x_arrayname_src, garray_class)))
pd_error(x, "%s: no such array", x->x_arrayname_src->s_name);
else if (!garray_getfloatwords(a_src, &npoints_src, &vec_src))