aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/list2lists.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/list2lists.c b/src/list2lists.c
index d181bf8..9f858d4 100644
--- a/src/list2lists.c
+++ b/src/list2lists.c
@@ -66,7 +66,12 @@ static void list2lists_list2(t_list2lists*x,t_symbol*s, int argc, t_atom*argv)
x->x_lcount=argc;
x->x_length=(t_int*)getbytes((x->x_lcount)*sizeof(t_int));
for(i=0; i<argc; i++) {
- x->x_length[i]=atom_getint(argv+i);
+ int index=atom_getint(argv+i);
+ if(index<0) {
+ pd_error(x, "[list2lists]: clamped negative index=%d to 0!", index);
+ index=0;
+ }
+ x->x_length[i]=index;
}
}