From 2ac6b601bf30a0e664326347d745bd05413679bb Mon Sep 17 00:00:00 2001 From: itsmattkc Date: Fri, 13 Mar 2020 17:03:27 +1100 Subject: [PATCH] renderer: fixed segfault when no texture is generated --- app/render/backend/opengl/openglproxy.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/render/backend/opengl/openglproxy.cpp b/app/render/backend/opengl/openglproxy.cpp index 2d2170da3..d486fbcd8 100644 --- a/app/render/backend/opengl/openglproxy.cpp +++ b/app/render/backend/opengl/openglproxy.cpp @@ -397,6 +397,10 @@ void OpenGLProxy::TextureToBuffer(const QVariant &tex_in, void *buffer) { OpenGLTextureCache::ReferencePtr texture = tex_in.value(); + if (!texture) { + return; + } + QOpenGLFunctions* f = QOpenGLContext::currentContext()->functions(); buffer_.Attach(texture->texture()); buffer_.Bind();