summaryrefslogtreecommitdiffstats
path: root/webkit/glue/webcursor_mac.mm
diff options
context:
space:
mode:
Diffstat (limited to 'webkit/glue/webcursor_mac.mm')
-rw-r--r--webkit/glue/webcursor_mac.mm4
1 files changed, 4 insertions, 0 deletions
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));