<https://bugs.webkit.org/show_bug.cgi?id=62666>
authorsullivan@apple.com <sullivan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 14 Jun 2011 22:18:05 +0000 (22:18 +0000)
committersullivan@apple.com <sullivan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 14 Jun 2011 22:18:05 +0000 (22:18 +0000)
commitaccad33df28b4b320043f1e60a789eb591d79c1a
treee4444543a8b10df1dd38815ddcf4aaba3065a425
parenta292f4c5bf56da2a25b96459ee1498ac926c019a
<https://bugs.webkit.org/show_bug.cgi?id=62666>
<rdar://problem/9606676>
Callers should be robust against WebImage::create() returning an image with a null snapshot

Reviewed by Dan Bernstein.

* Shared/API/c/cg/WKImageCG.cpp:
(WKImageCreateCGImage):
Return 0 if no bitmap was created.
(WKImageCreateFromCGImage):
Ditto.

* Shared/UserMessageCoders.h:
(WebKit::UserMessageEncoder::baseEncode):
Check for null before dereferencing image->bitmap() in two places.

* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::snapshotInViewCoordinates):
Return 0 if no bitmap was created.
(WebKit::WebPage::scaledSnapshotInDocumentCoordinates):
Ditto.
(WebKit::WebPage::createSnapshotOfVisibleContent):
Bail out if no bitmap was created.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@88856 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebKit2/ChangeLog
Source/WebKit2/Shared/API/c/cg/WKImageCG.cpp
Source/WebKit2/Shared/UserMessageCoders.h
Source/WebKit2/WebProcess/WebPage/WebPage.cpp