From c7025b456e551596907f82a27cb1991caa9fde4e Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Mon, 12 Dec 2016 12:16:31 +0100 Subject: 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 --- src/quick/scenegraph/coreapi/qsggeometry.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src') 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; } -- cgit v1.2.3