From: Andrew Knight Date: Thu, 6 Mar 2014 12:59:42 +0000 (+0200) Subject: QSGBatchRenderer: return when a shader is not returned by the manager X-Git-Tag: upstream/5.2.90+alpha~39 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3aa6a8b90f9c0e5f0ad72c462a15157b4e419ae6;p=platform%2Fupstream%2Fqtdeclarative.git QSGBatchRenderer: return when a shader is not returned by the manager If a shader can't be found from the manager (e.g., if it failed to link), return from rendering. This prevents the renderer from crashing on a null pointer. Task-number: QTBUG-37290 Change-Id: I44d0bbb721854c0bc6da681ff55f71140a5cb0bc Reviewed-by: Gunnar Sletta --- diff --git a/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp b/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp index 8a430c1..e271778 100644 --- a/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp +++ b/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp @@ -2040,6 +2040,8 @@ void Renderer::renderMergedBatch(const Batch *batch) QSGMaterial *material = gn->activeMaterial(); ShaderManager::Shader *sms = m_useDepthBuffer ? m_shaderManager->prepareMaterial(material) : m_shaderManager->prepareMaterialNoRewrite(material); + if (!sms) + return; QSGMaterialShader *program = sms->program; if (m_currentShader != sms) @@ -2124,6 +2126,8 @@ void Renderer::renderUnmergedBatch(const Batch *batch) QSGMaterial *material = gn->activeMaterial(); ShaderManager::Shader *sms = m_shaderManager->prepareMaterialNoRewrite(material); + if (!sms) + return; QSGMaterialShader *program = sms->program; if (sms != m_currentShader)