Location
Source/ERF_Tagging.cpp:856-862
Problem
ERF::HurricaneTracker() does:
FindInitialEye(...) only when time == 0.0
- otherwise reads
hurricane_eye_track_xy.back() with no emptiness check
If the vector is empty (e.g., restart, or tracker output not populated yet), this is undefined behavior and can cras
h.
Why this is a bug
The function assumes cross-module state was already populated, but does not enforce or validate that precondition.
Suggested patch
Guard access and fallback to FindInitialEye() when history is unavailable.
--- a/Source/ERF_Tagging.cpp
+++ b/Source/ERF_Tagging.cpp
@@
- if (time==0.0) {
+ if (time==0.0 || hurricane_eye_track_xy.empty()) {
is_found = FindInitialEye(levc, mf_cc_vel, velmag_threshold, eye_x, eye_y);
} else {
is_found = true;
const auto& last = hurricane_eye_track_xy.back();
eye_x = last[0];
eye_y = last[1];
}
Location
Source/ERF_Tagging.cpp:856-862Problem
ERF::HurricaneTracker()does:FindInitialEye(...)only whentime == 0.0hurricane_eye_track_xy.back()with no emptiness checkIf the vector is empty (e.g., restart, or tracker output not populated yet), this is undefined behavior and can cras
h.
Why this is a bug
The function assumes cross-module state was already populated, but does not enforce or validate that precondition.
Suggested patch
Guard access and fallback to
FindInitialEye()when history is unavailable.