2011-07-04 Jeff Timanus <twiz@chromium.org>
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 4 Jul 2011 18:16:34 +0000 (18:16 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 4 Jul 2011 18:16:34 +0000 (18:16 +0000)
        Reviewed by Stephen White.

        Prevent calls to GrapicsContext3D::deleteTexture with id 0 in DrawingBuffer::clear().
        https://bugs.webkit.org/show_bug.cgi?id=63756

        * platform/graphics/gpu/DrawingBuffer.cpp:
        (WebCore::DrawingBuffer::clear):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@90369 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/gpu/DrawingBuffer.cpp

index b93e101..048c014 100644 (file)
@@ -1,3 +1,13 @@
+2011-07-04  Jeff Timanus  <twiz@chromium.org>
+
+        Reviewed by Stephen White.
+
+        Prevent calls to GrapicsContext3D::deleteTexture with id 0 in DrawingBuffer::clear().
+        https://bugs.webkit.org/show_bug.cgi?id=63756
+
+        * platform/graphics/gpu/DrawingBuffer.cpp:
+        (WebCore::DrawingBuffer::clear):
+
 2011-07-04  Martin Robinson  <mrobinson@igalia.com>
 
         Reviewed by Andreas Kling.
index d2db67c..5ad2f5c 100644 (file)
@@ -58,36 +58,39 @@ void DrawingBuffer::clear()
 {
     if (!m_context)
         return;
-        
+
     m_context->makeContextCurrent();
-    m_context->deleteTexture(m_colorBuffer);
-    m_colorBuffer = 0;
-    
+
+    if (m_colorBuffer) {
+        m_context->deleteTexture(m_colorBuffer);
+        m_colorBuffer = 0;
+    }
+
     if (m_multisampleColorBuffer) {
         m_context->deleteRenderbuffer(m_multisampleColorBuffer);
         m_multisampleColorBuffer = 0;
     }
-    
+
     if (m_depthStencilBuffer) {
         m_context->deleteRenderbuffer(m_depthStencilBuffer);
         m_depthStencilBuffer = 0;
     }
-    
+
     if (m_depthBuffer) {
         m_context->deleteRenderbuffer(m_depthBuffer);
         m_depthBuffer = 0;
     }
-    
+
     if (m_stencilBuffer) {
         m_context->deleteRenderbuffer(m_stencilBuffer);
         m_stencilBuffer = 0;
     }
-    
+
     if (m_multisampleFBO) {
         m_context->deleteFramebuffer(m_multisampleFBO);
         m_multisampleFBO = 0;
     }
-        
+
     m_context->deleteFramebuffer(m_fbo);
     m_fbo = 0;
 }