summaryrefslogtreecommitdiffstats
path: root/src/opengl/gl2paintengineex/qtriangulatingstroker.cpp
diff options
context:
space:
mode:
authorJustin McPherson <justin.mcpherson@nokia.com>2010-01-07 07:21:30 (GMT)
committerJustin McPherson <justin.mcpherson@nokia.com>2010-01-07 07:21:30 (GMT)
commita3c1b0703575ed5fc364011c73dc104ecdb8ef0c (patch)
tree4e57559b1753c7b1eb3f375aa59eee6ea1108f70 /src/opengl/gl2paintengineex/qtriangulatingstroker.cpp
parentf9ffe24a87d67f39bb877224f7e2b6f7b3ad6c02 (diff)
parent7a5bca82738e6b782047e50a813972eccd928307 (diff)
downloadQt-a3c1b0703575ed5fc364011c73dc104ecdb8ef0c.zip
Qt-a3c1b0703575ed5fc364011c73dc104ecdb8ef0c.tar.gz
Qt-a3c1b0703575ed5fc364011c73dc104ecdb8ef0c.tar.bz2
Merge branch '4.6' of ../../4.6 into 4.6
Conflicts: examples/multimedia/audiodevices/audiodevices.cpp
Diffstat (limited to 'src/opengl/gl2paintengineex/qtriangulatingstroker.cpp')
-rw-r--r--src/opengl/gl2paintengineex/qtriangulatingstroker.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/opengl/gl2paintengineex/qtriangulatingstroker.cpp b/src/opengl/gl2paintengineex/qtriangulatingstroker.cpp
index 6082f49..395b8a3 100644
--- a/src/opengl/gl2paintengineex/qtriangulatingstroker.cpp
+++ b/src/opengl/gl2paintengineex/qtriangulatingstroker.cpp
@@ -62,8 +62,14 @@ void QTriangulatingStroker::endCapOrJoinClosed(const qreal *start, const qreal *
endCap(cur);
}
int count = m_vertices.size();
- m_vertices.add(m_vertices.at(count-2));
- m_vertices.add(m_vertices.at(count-1));
+
+ // Copy the (x, y) values because QDataBuffer::add(const float& t)
+ // may resize the buffer, which will leave t pointing at the
+ // previous buffer's memory region if we don't copy first.
+ float x = m_vertices.at(count-2);
+ float y = m_vertices.at(count-1);
+ m_vertices.add(x);
+ m_vertices.add(y);
}