[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: [kmymoney/4.8] libkdchart/src/KDChart/Cartesian: Fix 'Crash on investment charts with multiple inves
From: Ralf Habacker <null () kde ! org>
Date: 2017-08-31 17:48:07
Message-ID: E1dnTZX-0007Yp-Cf () code ! kde ! org
[Download RAW message or body]
Git commit a583dc9d434ec1f42bc417769adcf3449dea741c by Ralf Habacker.
Committed on 31/08/2017 at 17:47.
Pushed by habacker into branch '4.8'.
Fix 'Crash on investment charts with multiple investments'
The root cause of this crash is an implementation bug in
CartesianDiagramDataCompressor::slotColumnsAboutToBeInserted().
In case m_model is set, adding columns to m_data requires to add a
QVector<DataPoint> instance sized to the model row count. Instead the
size is limited to m_xResolution which depends on the diagram zoom factor
and other values. Having a too small sized column in m_data let
slotRowsAboutToBeInserted() crash.
This patch needs to be pushed upstream to have it in further kdiagram
releases.
Fixup of commit 7516308b.
BUG:384021
FIXED-IN:4.8.1
M +1 -1 libkdchart/src/KDChart/Cartesian/KDChartCartesianDiagramDataCompressor_p.cpp
https://commits.kde.org/kmymoney/a583dc9d434ec1f42bc417769adcf3449dea741c
diff --git a/libkdchart/src/KDChart/Cartesian/KDChartCartesianDiagramDataCompressor_p.cpp \
b/libkdchart/src/KDChart/Cartesian/KDChartCartesianDiagramDataCompressor_p.cpp index 64acf97e..5eb5a65d \
100644
--- a/libkdchart/src/KDChart/Cartesian/KDChartCartesianDiagramDataCompressor_p.cpp
+++ b/libkdchart/src/KDChart/Cartesian/KDChartCartesianDiagramDataCompressor_p.cpp
@@ -147,7 +147,7 @@ void CartesianDiagramDataCompressor::slotColumnsAboutToBeInserted( const QModelI
if ( !prepareDataChange( parent, false, &start, &end ) ) {
return;
}
- const int rowCount = qMin( m_model ? m_model->rowCount( m_rootIndex ) : 0, m_xResolution );
+ const int rowCount = m_model ? m_model->rowCount( m_rootIndex ) : m_xResolution;
Q_ASSERT( start >= 0 && start <= m_data.size() );
m_data.insert( start, end - start + 1, QVector< DataPoint >( rowCount ) );
}
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic