Bug 1268721 - part 2 - Null check first argument to nsContentUtils::GetSurfaceData(). r=jimm, a=ritu

This commit is contained in:
Andrew McCreight 2016-05-12 11:04:00 +02:00
parent 5b6a77c4b8
commit 4bedd9c01c
3 changed files with 21 additions and 13 deletions

View File

@ -7578,6 +7578,9 @@ nsContentUtils::TransferableToIPCTransferable(nsITransferable* aTransferable,
}
RefPtr<mozilla::gfx::DataSourceSurface> dataSurface =
surface->GetDataSurface();
if (!dataSurface) {
continue;
}
size_t length;
int32_t stride;
mozilla::UniquePtr<char[]> surfaceData =

View File

@ -1001,6 +1001,10 @@ PuppetWidget::SetCursor(imgIContainer* aCursor,
RefPtr<mozilla::gfx::DataSourceSurface> dataSurface =
surface->GetDataSurface();
if (!dataSurface) {
return NS_ERROR_FAILURE;
}
size_t length;
int32_t stride;
mozilla::UniquePtr<char[]> surfaceData =

View File

@ -51,7 +51,7 @@ nsDragServiceProxy::InvokeDragSessionImpl(nsISupportsArray* aArrayTransferables,
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 =
@ -67,6 +67,7 @@ nsDragServiceProxy::InvokeDragSessionImpl(nsISupportsArray* aArrayTransferables,
return NS_OK;
}
}
}
mozilla::Unused << child->SendInvokeDragSession(dataTransfers, aActionType,
nsCString(),