Title: [94982] trunk/Source/WebCore
Revision
94982
Author
commit-qu...@webkit.org
Date
2011-09-12 15:19:37 -0700 (Mon, 12 Sep 2011)

Log Message

[chromium]  Prevent a crash when tearing down an ImageBuffer that was not successfully initialized.
https://bugs.webkit.org/show_bug.cgi?id=67944

Patch by Jeff Timanus <t...@chromium.org> on 2011-09-12
Reviewed by Stephen White.

* platform/graphics/skia/ImageBufferSkia.cpp:
(WebCore::ImageBuffer::~ImageBuffer):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (94981 => 94982)


--- trunk/Source/WebCore/ChangeLog	2011-09-12 22:17:53 UTC (rev 94981)
+++ trunk/Source/WebCore/ChangeLog	2011-09-12 22:19:37 UTC (rev 94982)
@@ -1,3 +1,13 @@
+2011-09-12  Jeff Timanus  <t...@chromium.org>
+
+        [chromium]  Prevent a crash when tearing down an ImageBuffer that was not successfully initialized.
+        https://bugs.webkit.org/show_bug.cgi?id=67944
+
+        Reviewed by Stephen White.
+        
+        * platform/graphics/skia/ImageBufferSkia.cpp:
+        (WebCore::ImageBuffer::~ImageBuffer):
+
 2011-09-12  Michael Saboff  <msab...@apple.com>
 
         Update RegExp and related classes to use 8 bit strings when available

Modified: trunk/Source/WebCore/platform/graphics/skia/ImageBufferSkia.cpp (94981 => 94982)


--- trunk/Source/WebCore/platform/graphics/skia/ImageBufferSkia.cpp	2011-09-12 22:17:53 UTC (rev 94981)
+++ trunk/Source/WebCore/platform/graphics/skia/ImageBufferSkia.cpp	2011-09-12 22:19:37 UTC (rev 94982)
@@ -116,8 +116,10 @@
 
 ImageBuffer::~ImageBuffer()
 {
-    // This is so that the SkGpuDevice destructor has the correct context.
-    m_context->platformContext()->makeGrContextCurrent();
+    if (m_context && m_context->platformContext()) {
+        // This is so that the SkGpuDevice destructor has the correct context.
+        m_context->platformContext()->makeGrContextCurrent();
+    }
 }
 
 GraphicsContext* ImageBuffer::context() const
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to