From b9aded78adcbeac6579d4dbbb5591558f7bc705f Mon Sep 17 00:00:00 2001 From: Sean Harmer Date: Tue, 19 Jan 2016 13:50:18 +0000 Subject: Protect against a null surface in the renderview processing logic Change-Id: I31eab49aff2af5b9d2341709c506f9d5525994ac Reviewed-by: Paul Lemire --- src/render/backend/renderer.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/render') diff --git a/src/render/backend/renderer.cpp b/src/render/backend/renderer.cpp index 4b94ce00c..e6bf0cf86 100644 --- a/src/render/backend/renderer.cpp +++ b/src/render/backend/renderer.cpp @@ -694,6 +694,14 @@ bool Renderer::submitRenderViews() // If not, we have to free up the context from the previous surface // and make the context current on the new surface surface = renderView->surface(); + + // For now, if we do not have a surface, skip this renderview + // TODO: Investigate if it's worth providing a fallback offscreen surface + // to use when surface is null. Or if we should instead expose an + // offscreensurface to Qt3D. + if (!surface) + continue; + if (i != 0 && surface != previousSurface && previousSurface) m_graphicsContext->endDrawing(boundFboId == m_graphicsContext->defaultFBO()); -- cgit v1.2.3