<div dir="ltr"><div>As previous discussed in the thread &quot;Whose fault is this crash? (nan and inf)&quot;,</div><div>a patch is pasted below to fix the problem.</div><div><br></div><div>It might be possible to fix the problem a better way, by checking whether the integer index variable (called &quot;idelsamps&quot;) is within bounds, but the complexity</div>
<div>of the code goes a little bit above my head.</div><div><br></div><div>The other two situations mentioned in the thread that might have</div><div>this problem, namely tabread4~ and poke~, should not have</div><div>this problem since there are checks that the integer index values</div>
<div>are within bounds.</div><div><br></div><div><br></div><div>diff --git a/pure-data/src/d_array.c b/pure-data/src/d_array.c<br></div><div>index d365cf2..9c16a85 100644</div><div>--- a/pure-data/src/d_array.c</div><div>
+++ b/pure-data/src/d_array.c</div><div>@@ -423,7 +423,11 @@ static t_int *tabread4_tilde_perform(t_int *w)</div><div><br></div><div>     for (i = 0; i &lt; n; i++)</div><div>     {</div><div>-        double findex = *in++ + onset;</div>
<div>+        t_sample inval = *in++;</div><div>+        if(!isfinite(inval))</div><div>+          inval = 0.0f;</div><div>+</div><div>+        double findex = inval + onset;</div><div>         int index = findex;</div><div>
         t_sample frac,  a,  b,  c,  d, cminusb;</div><div>         static int count;</div><div><br></div></div>