From f61d3ade84989c3aecc2a60e980c680cff57f331 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20L=C3=BCbking?= Date: Thu, 8 Jan 2015 00:25:46 +0100 Subject: [PATCH] shortcut rendering textures for empty an rect it makes no sense and there's a good chance that in this case m_vbo is still nullptr and it will not be created since d->m_cachedSize will be an empty size as well -> nullptr access -> crash BUG: 337090 FIXED-IN: 5.2 --- libkwineffects/kwingltexture.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libkwineffects/kwingltexture.cpp b/libkwineffects/kwingltexture.cpp index 5ce633a41f..ad6afffd17 100644 --- a/libkwineffects/kwingltexture.cpp +++ b/libkwineffects/kwingltexture.cpp @@ -447,6 +447,8 @@ void GLTexture::unbind() void GLTexture::render(QRegion region, const QRect& rect, bool hardwareClipping) { Q_D(GLTexture); + if (rect.isEmpty()) + return; // nothing to paint and m_vbo is likely nullptr and d->m_cachedSize empty as well, #337090 if (rect.size() != d->m_cachedSize) { d->m_cachedSize = rect.size(); QRect r(rect);