[SCM] WebKit Debian packaging branch, webkit-1.2, updated. upstream/1.1.90-6072-g9a69373

bfulgham at webkit.org bfulgham at webkit.org
Thu Apr 8 00:53:44 UTC 2010


The following commit has been merged in the webkit-1.2 branch:
commit f53cff40ee59fab66b26c625c74c599f3c55955b
Author: bfulgham at webkit.org <bfulgham at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Mon Jan 4 20:28:01 2010 +0000

    Correct debug assertion (and possible runtime errors) by
    checking validity of bitmap settings used to create
    the Windows Cairo contexts.
    https://bugs.webkit.org/show_bug.cgi?id=33164.
    
    Reviewed by Adam Roben.
    
    * platform/graphics/win/GraphicsContextCairoWin.cpp:
    (WebCore::createCairoContextWithHDC): Check validity of selected
      OBJ_BITMAP retrieved, and only create 32-bit context when
      a valid bitmap is provided.
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@52752 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index a3a025e..2bad0f6 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,17 @@
+2010-01-04  Brent Fulgham  <bfulgham at webkit.org>
+
+        Reviewed by Adam Roben.
+
+        Correct debug assertion (and possible runtime errors) by
+        checking validity of bitmap settings used to create
+        the Windows Cairo contexts.
+        https://bugs.webkit.org/show_bug.cgi?id=33164.
+
+        * platform/graphics/win/GraphicsContextCairoWin.cpp:
+        (WebCore::createCairoContextWithHDC): Check validity of selected
+          OBJ_BITMAP retrieved, and only create 32-bit context when
+          a valid bitmap is provided.
+
 2010-01-04  Dmitry Titov  <dimich at chromium.org>
 
         Not reviewed, revert r52745 and r52746 on behalf of Nikolas Zimmermann, as discussed on IRC.
diff --git a/WebCore/platform/graphics/win/GraphicsContextCairoWin.cpp b/WebCore/platform/graphics/win/GraphicsContextCairoWin.cpp
index 61ae76c..43d92fb 100644
--- a/WebCore/platform/graphics/win/GraphicsContextCairoWin.cpp
+++ b/WebCore/platform/graphics/win/GraphicsContextCairoWin.cpp
@@ -40,21 +40,26 @@ static cairo_t* createCairoContextWithHDC(HDC hdc, bool hasAlpha)
 {
     // Put the HDC In advanced mode so it will honor affine transforms.
     SetGraphicsMode(hdc, GM_ADVANCED);
-    
+
+    cairo_surface_t* surface = 0;
+
     HBITMAP bitmap = static_cast<HBITMAP>(GetCurrentObject(hdc, OBJ_BITMAP));
 
     BITMAP info;
-    GetObject(bitmap, sizeof(info), &info);
-    ASSERT(info.bmBitsPixel == 32);
+    if (!GetObject(bitmap, sizeof(info), &info))
+        surface = cairo_win32_surface_create(hdc);
+    else {
+        ASSERT(info.bmBitsPixel == 32);
 
-    cairo_surface_t* image = cairo_image_surface_create_for_data((unsigned char*)info.bmBits,
+        surface = cairo_image_surface_create_for_data((unsigned char*)info.bmBits,
                                                CAIRO_FORMAT_ARGB32,
                                                info.bmWidth,
                                                info.bmHeight,
                                                info.bmWidthBytes);
+    }
 
-    cairo_t* context = cairo_create(image);
-    cairo_surface_destroy(image);
+    cairo_t* context = cairo_create(surface);
+    cairo_surface_destroy(surface);
 
     return context;
 }

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list