Skip to content
Snippets Groups Projects
Commit 3a59756c authored by Jonathan Wilkes's avatar Jonathan Wilkes
Browse files

port from Pd Vanilla: assert table-sizes in tabread4~

tabread4~ needs at least 4 samples to interpolate;
this patch adds guards in order to not access out-of-bound indices in the table,
in case the table is smaller than 4 samples.
commit e667894370ec22bc1d1d844443d90f1a76adc03e
parent 06c22c25
No related branches found
No related tags found
No related merge requests found
...@@ -298,6 +298,7 @@ static t_int *tabread_tilde_perform(t_int *w) ...@@ -298,6 +298,7 @@ static t_int *tabread_tilde_perform(t_int *w)
int i; int i;
maxindex = x->x_npoints - 1; maxindex = x->x_npoints - 1;
if (maxindex < 0) goto zero;
if (!buf) goto zero; if (!buf) goto zero;
for (i = 0; i < n; i++) for (i = 0; i < n; i++)
...@@ -398,6 +399,7 @@ static t_int *tabread4_tilde_perform(t_int *w) ...@@ -398,6 +399,7 @@ static t_int *tabread4_tilde_perform(t_int *w)
int i; int i;
maxindex = x->x_npoints - 3; maxindex = x->x_npoints - 3;
if (maxindex < 0) goto zero;
if (!buf) goto zero; if (!buf) goto zero;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment