summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--webkit/api/src/WebImageCG.cpp2
-rw-r--r--webkit/glue/webcursor_mac.mm4
2 files changed, 5 insertions, 1 deletions
diff --git a/webkit/api/src/WebImageCG.cpp b/webkit/api/src/WebImageCG.cpp
index 34cee01..1c28929 100644
--- a/webkit/api/src/WebImageCG.cpp
+++ b/webkit/api/src/WebImageCG.cpp
@@ -76,7 +76,7 @@ void WebImage::assign(const WebImage& image)
bool WebImage::isNull() const
{
- return m_imageRef != 0;
+ return m_imageRef == 0;
}
WebSize WebImage::size() const
diff --git a/webkit/glue/webcursor_mac.mm b/webkit/glue/webcursor_mac.mm
index 0b06df8..da42479 100644
--- a/webkit/glue/webcursor_mac.mm
+++ b/webkit/glue/webcursor_mac.mm
@@ -49,6 +49,10 @@ CGImageRef CreateCGImageFromCustomData(const std::vector<char>& custom_data,
NSCursor* CreateCustomCursor(const std::vector<char>& custom_data,
const gfx::Size& custom_size,
const gfx::Point& hotspot) {
+ // CG throws a cocoa exception if we try to create an empty image, which
+ // results in an infinite loop. This CHECK ensures that we crash instead.
+ CHECK(!custom_data.empty());
+
scoped_cftyperef<CGImageRef> cg_image(
CreateCGImageFromCustomData(custom_data, custom_size));