mirror of
https://github.com/OPM/ResInsight.git
synced 2026-10-13 08:52:14 -05:00
#4395 Robustness : Guard array out of bounds access
This commit is contained in:
1 parent
29ec970b02
commit
ac8ea73c36
2 files changed
+19
-11
No files matched your search
@@ -113,20 +113,23 @@ RiuFlowCharacteristicsPlot::~RiuFlowCharacteristicsPlot()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuFlowCharacteristicsPlot::setLorenzCurve(const QStringList& dateTimeStrings, const std::vector<QDateTime>& dateTimes, const std::vector<double>& timeHistoryValues)
|
||||
{
|
||||
initializeColors(dateTimes);
|
||||
|
||||
m_lorenzPlot->detachItems(QwtPlotItem::Rtti_PlotCurve, true);
|
||||
|
||||
for (size_t tsIdx = 0; tsIdx < dateTimes.size(); ++tsIdx)
|
||||
if (!dateTimes.empty())
|
||||
{
|
||||
if (timeHistoryValues[tsIdx] == HUGE_VAL) continue;
|
||||
initializeColors(dateTimes);
|
||||
|
||||
QDateTime dateTime = dateTimes[tsIdx];
|
||||
double timeHistoryValue = timeHistoryValues[tsIdx];
|
||||
for (size_t tsIdx = 0; tsIdx < dateTimes.size(); ++tsIdx)
|
||||
{
|
||||
if (timeHistoryValues[tsIdx] == HUGE_VAL) continue;
|
||||
|
||||
QString curveName = dateTimeStrings[static_cast<int>(tsIdx)];
|
||||
QDateTime dateTime = dateTimes[tsIdx];
|
||||
double timeHistoryValue = timeHistoryValues[tsIdx];
|
||||
|
||||
RiuFlowCharacteristicsPlot::addCurveWithLargeSymbol(m_lorenzPlot, curveName, m_dateToColorMap[dateTime], dateTime, timeHistoryValue);
|
||||
QString curveName = dateTimeStrings[static_cast<int>(tsIdx)];
|
||||
|
||||
RiuFlowCharacteristicsPlot::addCurveWithLargeSymbol(m_lorenzPlot, curveName, m_dateToColorMap[dateTime], dateTime, timeHistoryValue);
|
||||
}
|
||||
}
|
||||
|
||||
m_lorenzPlot->replot();
|
||||
|
||||
Reference in new issue
Block a user