Another null-deref under WebDragClient::startDrag

https://bugs.webkit.org/show_bug.cgi?id=120145
<rdar://problem/14650652>

Reviewed by Simon Fraser.

convertImageToBitmap can legitimately return null, so don't dereference it.

* WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
(WebKit::WebDragClient::startDrag):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154433 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 3d54f8b4
2013-08-21 Tim Horton <timothy_horton@apple.com>
Another null-deref under WebDragClient::startDrag
https://bugs.webkit.org/show_bug.cgi?id=120145
<rdar://problem/14650652>
Reviewed by Simon Fraser.
convertImageToBitmap can legitimately return null, so don't dereference it.
* WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
(WebKit::WebDragClient::startDrag):
2013-08-21 Beth Dakin <bdakin@apple.com>
<https://webkit.org/b/120140> Clients expect didFirstLayout-related calls to
......
......@@ -82,7 +82,7 @@ void WebDragClient::startDrag(RetainPtr<NSImage> image, const IntPoint& point, c
bitmapSize.scale(frame->page()->deviceScaleFactor());
RefPtr<ShareableBitmap> bitmap = convertImageToBitmap(image.get(), bitmapSize);
ShareableBitmap::Handle handle;
if (!bitmap->createHandle(handle))
if (!bitmap || !bitmap->createHandle(handle))
return;
// FIXME: Seems this message should be named StartDrag, not SetDragImage.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment