From da98793a6bec755c99041aa95f1a2c93b4ead250 Mon Sep 17 00:00:00 2001 From: itsmattkc Date: Wed, 11 Dec 2019 13:54:19 +1100 Subject: [PATCH] fixed segfault if pipeline returned an empty texture --- app/render/backend/opengl/openglbackend.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/render/backend/opengl/openglbackend.cpp b/app/render/backend/opengl/openglbackend.cpp index 0ed6aef33..b05a204cd 100644 --- a/app/render/backend/opengl/openglbackend.cpp +++ b/app/render/backend/opengl/openglbackend.cpp @@ -167,7 +167,13 @@ void OpenGLBackend::ThreadCompletedFrame(NodeDependency path, QByteArray hash, N // Check if this frame has changed once again, in which case we may not want to draw it (it'll look jittery to the user) if (!TimeIsQueued(TimeRange(path.in(), path.in()))) { // FIXME: This texture is part of the texture cache and therefore volatile, we should probably copy it here instead - emit CachedFrameReady(path.in(), QVariant::fromValue(value.value()->texture())); + OpenGLTexturePtr tex = nullptr; + + if (!value.isNull()) { + tex = value.value()->texture(); + } + + emit CachedFrameReady(path.in(), QVariant::fromValue(tex)); } // Queue up a new frame for this worker