Skip to content
Snippets Groups Projects
Commit ec6e4e52 authored by Jonathan Guinet's avatar Jonathan Guinet
Browse files

BUG: bad memory access in ComputeInterval method from SpectralResponse class.

parent 873b6692
No related branches found
No related tags found
No related merge requests found
...@@ -239,7 +239,7 @@ SpectralResponse<TPrecision, TValuePrecision> ...@@ -239,7 +239,7 @@ SpectralResponse<TPrecision, TValuePrecision>
while ((*it).second <= m_SensitivityThreshold) while ((*it).second <= m_SensitivityThreshold)
{ {
++it; ++it;
if (it == m_Response.end()) if (it == (m_Response.end()-1))
{ {
m_Interval.first = static_cast<TPrecision> (0.0); m_Interval.first = static_cast<TPrecision> (0.0);
m_Interval.second = static_cast<TPrecision> (0.0); m_Interval.second = static_cast<TPrecision> (0.0);
...@@ -249,15 +249,16 @@ SpectralResponse<TPrecision, TValuePrecision> ...@@ -249,15 +249,16 @@ SpectralResponse<TPrecision, TValuePrecision>
} }
m_Interval.first = (*it).first; m_Interval.first = (*it).first;
it = (m_Response.end()-1);
while ((*it).second > m_SensitivityThreshold) while ((*it).second <= m_SensitivityThreshold)
{ {
if (it == m_Response.end()) if (it == (m_Response.begin()))
{ {
m_Interval.second = (*it).first; m_Interval.second = (*it).first;
m_IntervalComputed = true;
return; return;
} }
++it; --it;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment