aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2016-12-12 12:16:31 +0100
committerUlf Hermann <ulf.hermann@qt.io>2016-12-20 11:27:53 +0000
commitc7025b456e551596907f82a27cb1991caa9fde4e (patch)
tree804f5ec13dc24ee2fba01b2a7c11f028f99650d6 /src
parent054dbb0bee0a9cc2a9cb2d36bca72dedd9f08a3e (diff)
Q_CHECK_PTR QSGGeometry allocations
We want to cleanly crash if they fail, rather than return a null pointer from vertexData(). Change-Id: Ie88adaa9f0977c70ef4a47a59463509dcd15bdcf Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
Diffstat (limited to 'src')
-rw-r--r--src/quick/scenegraph/coreapi/qsggeometry.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/quick/scenegraph/coreapi/qsggeometry.cpp b/src/quick/scenegraph/coreapi/qsggeometry.cpp
index a278c6079b..69a8c21ed2 100644
--- a/src/quick/scenegraph/coreapi/qsggeometry.cpp
+++ b/src/quick/scenegraph/coreapi/qsggeometry.cpp
@@ -675,6 +675,7 @@ void QSGGeometry::allocate(int vertexCount, int indexCount)
Q_ASSERT(m_index_type == UnsignedIntType || m_index_type == UnsignedShortType);
int indexByteSize = indexCount * (m_index_type == UnsignedShortType ? sizeof(quint16) : sizeof(quint32));
m_data = (void *) malloc(vertexByteSize + indexByteSize);
+ Q_CHECK_PTR(m_data);
m_index_data_offset = vertexByteSize;
m_owns_data = true;
}