This patch sometimes crashes PD:

[0.0000000000000000000000000000000001 (
|
[expr 1/$f1]
|
[env~]
|
[vd~ buffer 100]

[delwrite~ buffer]

The output of expr is inf.
The output of env~ is nan

vd~ doesn't always handle nan, and crashes.

A fix for vd~ can look like this:

--- a/pure-data/src/d_delay.c
+++ b/pure-data/src/d_delay.c
@@ -271,7 +271,11 @@ static t_int *sigvd_perform(t_int *w)
     t_sample zerodel = x->x_zerodel;
     while (n--)
     {
-        t_sample delsamps = x->x_sr * *in++ - zerodel, frac;
+      t_sample inval = *in++;
+      if(isnan(inval))
+        inval = 0.0f;
+
+        t_sample delsamps = x->x_sr * inval - zerodel, frac;


In Pd, should objects be able to handle (i.e. "not crash") when they get
input values of nan and inf, or should they instead make sure that
nan and inf never can be sent out of the objects, or both?