Prevent access to non-existent memory in QGL2PEXVertexArray
authorTopi Reiniö <topi.reinio@nokia.com>
Thu, 4 Nov 2010 13:20:02 +0000 (14:20 +0100)
committerTopi Reiniö <topi.reinio@nokia.com>
Thu, 4 Nov 2010 13:20:02 +0000 (14:20 +0100)
commit440888de851daad78d89f2958aa95e9193832fb5
tree5a0fac499bbba1154dd5bb5c90fda0de28c1435f
parent018c0ebc7d7ffaa55bf5a80b2a8a0e3ee1ebcc7b
Prevent access to non-existent memory in QGL2PEXVertexArray

QGL2PEXVertexArray::addClosingLine() uses using QDataBuffer::add() to
add a QPointF at the end, with a const reference to another value in
the same array. As add() resizes and possibly relocates the buffer, an
already-released memory location may be accessed.

This change copies the value into a temporary variable before resizing
the array.

Task-number: QTBUG-14944
Reviewed-by: Samuel
src/opengl/gl2paintengineex/qgl2pexvertexarray.cpp