Bug 1278452 - Avoid a null deref in widget/. r=karlt.
authorNicholas Nethercote <nnethercote@mozilla.com>
Tue, 07 Jun 2016 16:03:34 +1000
changeset 301031 cf7ac0a043f9d45fc4c852e26d1d59e4d1ee7468
parent 301030 2202233b5b183143c85ab7a65b84a90003c262b3
child 301032 ae2bafad2ec2e5a2de35bce1b5e8939e8d26cff5
push id30324
push usercbook@mozilla.com
push dateWed, 08 Jun 2016 09:58:15 +0000
treeherderautoland@f8ad071a6e14 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskarlt
bugs1278452
milestone50.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1278452 - Avoid a null deref in widget/. r=karlt.
widget/nsDragServiceProxy.cpp
--- a/widget/nsDragServiceProxy.cpp
+++ b/widget/nsDragServiceProxy.cpp
@@ -45,25 +45,25 @@ nsDragServiceProxy::InvokeDragSessionImp
     nsPresContext* pc;
     RefPtr<mozilla::gfx::SourceSurface> surface;
     DrawDrag(mSourceNode, aRegion, mScreenX, mScreenY,
              &dragRect, &surface, &pc);
 
     if (surface) {
       RefPtr<mozilla::gfx::DataSourceSurface> dataSurface =
         surface->GetDataSurface();
-      mozilla::gfx::IntSize size = dataSurface->GetSize();
       if (dataSurface) {
         size_t length;
         int32_t stride;
         mozilla::UniquePtr<char[]> surfaceData =
           nsContentUtils::GetSurfaceData(WrapNotNull(dataSurface), &length,
                                          &stride);
         nsDependentCString dragImage(surfaceData.get(), length);
 
+        mozilla::gfx::IntSize size = dataSurface->GetSize();
         mozilla::Unused <<
           child->SendInvokeDragSession(dataTransfers, aActionType, dragImage,
                                        size.width, size.height, stride,
                                        static_cast<uint8_t>(dataSurface->GetFormat()),
                                        dragRect.x, dragRect.y);
         StartDragSession();
         return NS_OK;
       }