Commit 639b6430 authored by Matus Uzak's avatar Matus Uzak
Browse files

ppt: Fixed a crash in setEnhancedGeometry - complex data related.

TODO: There's something wrong with complex properties, because the test file
was crashing only sometimes.  Another workaround might be needed because some
of the old MS Office versions is messing up the complex data.

BUG:286712
parent c3cc3c17
......@@ -1092,9 +1092,9 @@ void ODrawToOdf::setEnhancedGeometry(const MSO::OfficeArtSpContainer& o, Writer&
const DrawStyle ds(drawingGroup, master, &o);
IMsoArray _v = ds.pVertices_complex();
IMsoArray _c = ds.pSegmentInfo_complex();
IMsoArray segmentInfo = ds.pSegmentInfo_complex();
if (!_v.data.isEmpty() && !_c.data.isEmpty()) {
if (!_v.data.isEmpty() && !segmentInfo.data.isEmpty()) {
QVector<QPoint> verticesPoints;
......@@ -1144,9 +1144,9 @@ void ODrawToOdf::setEnhancedGeometry(const MSO::OfficeArtSpContainer& o, Writer&
ushort msopathtype;
bool nOffRange = false;
for (int i = 0, n = 0; ((i < _c.nElems) && !nOffRange); i++) {
for (int i = 0, n = 0; ((i < segmentInfo.nElems) && !nOffRange); i++) {
msopathtype = (((*(ushort *)(_c.data.data() + i * 2)) >> 13) & 0x7);
msopathtype = (((*(ushort *)(segmentInfo.data.data() + i * 2)) >> 13) & 0x7);
switch (msopathtype) {
case msopathLineTo:
......@@ -1163,7 +1163,7 @@ void ODrawToOdf::setEnhancedGeometry(const MSO::OfficeArtSpContainer& o, Writer&
}
case msopathCurveTo:
{
if (n + 2 > verticesPoints.size()) {
if (n + 2 >= verticesPoints.size()) {
qDebug() << "EnhancedGeometry: index into verticesPoints out of range!";
nOffRange = true;
break;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment