Bug 63484 - [Windows, WinCairo] Don't Attempt to Create Zero-Size DIB
Summary: [Windows, WinCairo] Don't Attempt to Create Zero-Size DIB
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC Windows 7
: P2 Normal
Assignee: Brent Fulgham
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-06-27 14:44 PDT by Brent Fulgham
Modified: 2011-06-28 08:42 PDT (History)
3 users (show)

See Also:


Attachments
Patch (1.46 KB, patch)
2011-06-27 14:51 PDT, Brent Fulgham
aroben: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Brent Fulgham 2011-06-27 14:44:53 PDT
While investigating a separate issue, I noticed that I was hitting an assertion in the Cairo drawing layer because it was attempting to use an invalid HBITMAP created in the WebNodeHighlight::update method.  The underlying issue was that the CreateDIBSection function was failing, because it was being requested to create a section of zero height.

I think the attached patch would be safe for the CoreGraphics and Cairo ports, but wanted to see if anyone knew of a reason why it would be bad to exit early in the case of a zero height (or zero width) paint region.
Comment 1 Brent Fulgham 2011-06-27 14:51:38 PDT
Created attachment 98790 [details]
Patch
Comment 2 Adam Roben (:aroben) 2011-06-28 08:10:55 PDT
Comment on attachment 98790 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=98790&action=review

> Source/WebKit/win/WebNodeHighlight.cpp:155
> +    ASSERT_WITH_MESSAGE(hbmp.get(), "::CreateDIBSection failed with error %lu", ::GetLastError());

No need for the .get() here.
Comment 3 Brent Fulgham 2011-06-28 08:42:31 PDT
Committed r89932: <http://trac.webkit.org/changeset/89932>