Title: [89932] trunk/Source/WebKit/win
Revision
89932
Author
[email protected]
Date
2011-06-28 08:42:04 -0700 (Tue, 28 Jun 2011)

Log Message

2011-06-27  Brent Fulgham  <[email protected]>

        Reviewed by Adam Roben.

        Avoid attempt to create a zero-size DIB.
        https://bugs.webkit.org/show_bug.cgi?id=63484.

        * WebNodeHighlight.cpp:
        (WebNodeHighlight::update): Check for zero-height (or zero-width)
        region for DIB, and exit early if attempting to create a zero-size
        DIB/BITMAP.

Modified Paths

Diff

Modified: trunk/Source/WebKit/win/ChangeLog (89931 => 89932)


--- trunk/Source/WebKit/win/ChangeLog	2011-06-28 15:24:19 UTC (rev 89931)
+++ trunk/Source/WebKit/win/ChangeLog	2011-06-28 15:42:04 UTC (rev 89932)
@@ -1,3 +1,15 @@
+2011-06-27  Brent Fulgham  <[email protected]>
+
+        Reviewed by Adam Roben.
+
+        Avoid attempt to create a zero-size DIB.
+        https://bugs.webkit.org/show_bug.cgi?id=63484.
+
+        * WebNodeHighlight.cpp:
+        (WebNodeHighlight::update): Check for zero-height (or zero-width)
+        region for DIB, and exit early if attempting to create a zero-size
+        DIB/BITMAP.
+
 2011-06-24  Dan Bernstein  <[email protected]>
 
         Reviewed by Anders Carlsson.

Modified: trunk/Source/WebKit/win/WebNodeHighlight.cpp (89931 => 89932)


--- trunk/Source/WebKit/win/WebNodeHighlight.cpp	2011-06-28 15:24:19 UTC (rev 89931)
+++ trunk/Source/WebKit/win/WebNodeHighlight.cpp	2011-06-28 15:42:04 UTC (rev 89932)
@@ -145,10 +145,14 @@
     size.cx = webViewRect.right - webViewRect.left;
     size.cy = webViewRect.bottom - webViewRect.top;
 
+    if (!size.cx || !size.cy)
+        return;
+
     BitmapInfo bitmapInfo = BitmapInfo::createBottomUp(IntSize(size));
 
     void* pixels = 0;
     OwnPtr<HBITMAP> hbmp = adoptPtr(::CreateDIBSection(hdc, &bitmapInfo, DIB_RGB_COLORS, &pixels, 0, 0));
+    ASSERT_WITH_MESSAGE(hbmp, "::CreateDIBSection failed with error %lu", ::GetLastError());
 
     ::SelectObject(hdc, hbmp.get());
 
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to