Changeset 198243 in webkit


Ignore:
Timestamp:
Mar 15, 2016 4:59:24 PM (8 years ago)
Author:
Simon Fraser
Message:

Occasional crash under GraphicsContext::platformContext() when dragging Google maps
https://bugs.webkit.org/show_bug.cgi?id=155521
rdar://problem/24357307

Reviewed by Tim Horton.

It's possible for createDragImageForSelection() to return a null image, if the bounds
of the selection are an empty rect. That would cause a crash under convertImageToBitmap()
because a zero-sized ShareableBitmap will return a null GraphicsContext.

To avoid this, early return from DragController::startDrag() if the dragImage is null.

I wasn't able to come up with a test for this.

  • page/DragController.cpp:

(WebCore::DragController::startDrag):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r198239 r198243  
     12016-03-15  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Occasional crash under GraphicsContext::platformContext when dragging Google maps
     4        https://bugs.webkit.org/show_bug.cgi?id=155521
     5        rdar://problem/24357307
     6
     7        Reviewed by Tim Horton.
     8
     9        It's possible for createDragImageForSelection() to return a null image, if the bounds
     10        of the selection are an empty rect. That would cause a crash under convertImageToBitmap()
     11        because a zero-sized ShareableBitmap will return a null GraphicsContext.
     12       
     13        To avoid this, early return from DragController::startDrag() if the dragImage is null.
     14       
     15        I wasn't able to come up with a test for this.
     16
     17        * page/DragController.cpp:
     18        (WebCore::DragController::startDrag):
     19
    1202016-03-15  Tim Horton  <timothy_horton@apple.com>
    221
  • trunk/Source/WebCore/page/DragController.cpp

    r195848 r198243  
    839839            m_dragOffset = IntPoint(dragOrigin.x() - dragLoc.x(), dragOrigin.y() - dragLoc.y());
    840840        }
     841
     842        if (!dragImage)
     843            return false;
     844
    841845        doSystemDrag(dragImage, dragLoc, dragOrigin, dataTransfer, src, false);
    842846    } else if (!src.document()->securityOrigin()->canDisplay(linkURL)) {
Note: See TracChangeset for help on using the changeset viewer.