Commit 00b698c
Mark Stalzer
variance_measure_add: skip non-finite input instead of asserting
An assert(isfinite(d[i])) crash here corrupts the on-disk libsurvive
config because the process dies mid-write. Corrupt optical angles
(e.g. bad FPGA timestamps during USB disturbances) can produce NaN or
Inf values that reach this function; crashing is strictly worse than
dropping one sample, which has negligible effect on the variance estimate.
Replace the assert with an early-return guard that logs to stderr and
leaves the accumulator unchanged.1 parent eb409fc commit 00b698c
1 file changed
Lines changed: 12 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
15 | 27 | | |
16 | 28 | | |
17 | 29 | | |
18 | | - | |
19 | 30 | | |
20 | 31 | | |
21 | 32 | | |
| |||
0 commit comments