Fix segmentation fault when using utils.find_peaks.decluster_distance_time with more than 46340 detections (46341^2 --> int32 overflow for distance_index in find_peaks.c/decluster_dist_time and find_peaks.c/decluster_dist_time_ll).
Why was it initiated? Any relevant Issues?
Only distance_index was defined as int, while all other indices / lengths in the c-libraries are at least of type long. So I expect no negative side effects from this fix. Let me know if we need an explicit test for this.
Minimal working example to demonstrate the previous segmentation fault:
[X] This PR is not directly related to an existing issue (which has no PR yet).
[ ] All tests still pass.
~- [ ] Any new features or fixed regressions are be covered via new tests.~
~- [ ] Any new or changed features have are fully documented.~
[X] Significant changes have been added to CHANGES.md.
~- [ ] First time contributors have added your name to CONTRIBUTORS.md.~
What does this PR do?
Fix segmentation fault when using
utils.find_peaks.decluster_distance_time
with more than 46340 detections (46341^2 --> int32 overflow fordistance_index
infind_peaks.c/decluster_dist_time
andfind_peaks.c/decluster_dist_time_ll
).Why was it initiated? Any relevant Issues?
Only
distance_index
was defined asint
, while all other indices / lengths in the c-libraries are at least of typelong
. So I expect no negative side effects from this fix. Let me know if we need an explicit test for this.Minimal working example to demonstrate the previous segmentation fault:
PR Checklist
develop
base branch selected?CHANGES.md
. ~- [ ] First time contributors have added your name toCONTRIBUTORS.md
.~