cntools / libsurvive

Open Source Lighthouse Tracking System
MIT License
747 stars 137 forks source link

Gen2 reproject function has underspecified floating point array values #290

Closed asymingt closed 1 year ago

asymingt commented 1 year ago

Describe the bug

In the Gen2 reproject implementation we have a function calc_cal_series which uses an array of six values const FLT f[6] = {...} where only four values are specified. Is this intentional, given that the loop that happens on L56 accesses offset 4 and 5, which wouldn't have been set at initialization time. https://github.com/cntools/libsurvive/blob/master/src/survive_reproject_gen2.c#L53.

Is this intentional? Are these parameters assumed to be zero, and if this is the case, are they guaranteed to be zeroed by C value-initialization?

asymingt commented 1 year ago

I found the python code responsible for autogenerating this elsewhere in the repo and can confirm that the final two elements are intended to be zero, which is the default C value for underspecified arrays.