From e251d9316f89fc766ece8e87fafafa281142061d Mon Sep 17 00:00:00 2001 From: Lucas Murray Date: Fri, 16 Oct 2009 10:36:17 +0000 Subject: [PATCH] Detect when we receive an incomplete FBO and consider it invalid. CCBUG: 210678 svn path=/trunk/KDE/kdebase/workspace/; revision=1036024 --- lib/kwinglutils.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/lib/kwinglutils.cpp b/lib/kwinglutils.cpp index 541a97bde5..353c14bf60 100644 --- a/lib/kwinglutils.cpp +++ b/lib/kwinglutils.cpp @@ -1017,13 +1017,16 @@ void GLRenderTarget::initFBO() mTexture->target(), mTexture->texture(), 0); GLenum status = glCheckFramebufferStatus(GL_FRAMEBUFFER_EXT); - if(status != GL_FRAMEBUFFER_COMPLETE_EXT) - { - kError(1212) << "Invalid fb status: " << status << endl; - } glBindFramebuffer(GL_FRAMEBUFFER_EXT, 0); + if( status != GL_FRAMEBUFFER_COMPLETE_EXT ) + { // We have an incomplete framebuffer, consider it invalid + kError(1212) << "Invalid framebuffer status: " << status; + glDeleteFramebuffers(1, &mFramebuffer); + return; + } + mValid = true; }