2009-03-02 Brett Wilson <brettw@chromium.org>
authorbrettw@chromium.org <brettw@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 3 Mar 2009 17:50:24 +0000 (17:50 +0000)
committerbrettw@chromium.org <brettw@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 3 Mar 2009 17:50:24 +0000 (17:50 +0000)
        Fix uninitialized memory reads in the Chromium Windows transparency
        code that were identified by Purify,

        Reviewed by Darin Disher.

        * platform/graphics/chromium/TransparencyWin.cpp:
        (WebCore::TransparencyWin::OwnedBuffers::OwnedBuffers):
        (WebCore::TransparencyWin::initializeNewContext):

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

WebCore/ChangeLog
WebCore/platform/graphics/chromium/TransparencyWin.cpp

index 242f7374897d33e2f97dd07b3443d8eeabe0e10d..7ca0a08aeb6dfb759b0399f1f0acc4e466822e7b 100644 (file)
@@ -1,3 +1,14 @@
+2009-03-02  Brett Wilson  <brettw@chromium.org>
+
+        Fix uninitialized memory reads in the Chromium Windows transparency
+        code that were identified by Purify,
+
+        Reviewed by Darin Disher.
+
+        * platform/graphics/chromium/TransparencyWin.cpp:
+        (WebCore::TransparencyWin::OwnedBuffers::OwnedBuffers):
+        (WebCore::TransparencyWin::initializeNewContext):
+
 2009-03-02  Simon Fraser  <simon.fraser@apple.com>
 
         Reviewed by Dave Hyatt
index f2611af6743d8bfa85d8c8f8e9f5733400b27c94..8a82d2a0b58394599424a5a83e092f9d65e5c6e9 100644 (file)
@@ -114,6 +114,7 @@ public:
         if (needReferenceBuffer) {
             m_referenceBitmap.setConfig(SkBitmap::kARGB_8888_Config, size.width(), size.height());
             m_referenceBitmap.allocPixels();
+            m_referenceBitmap.eraseARGB(0, 0, 0, 0);
         }
     }
 
@@ -353,7 +354,9 @@ void TransparencyWin::initializeNewContext()
         // all layer modes will clear it in their initialization.
         m_layerBuffer = m_cachedBuffers->destBitmap();
         m_drawContext = m_cachedBuffers->destBitmap()->context();
+        bitmapForContext(*m_drawContext).eraseARGB(0, 0, 0, 0);
         m_referenceBitmap = m_cachedBuffers->referenceBitmap();
+        m_referenceBitmap->eraseARGB(0, 0, 0, 0);
         return;
     }