mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1268721 - part 2 - Null check first argument to nsContentUtils::GetSurfaceData(). r=jimm, a=ritu
This commit is contained in:
parent
5b6a77c4b8
commit
4bedd9c01c
@ -7578,6 +7578,9 @@ nsContentUtils::TransferableToIPCTransferable(nsITransferable* aTransferable,
|
|||||||
}
|
}
|
||||||
RefPtr<mozilla::gfx::DataSourceSurface> dataSurface =
|
RefPtr<mozilla::gfx::DataSourceSurface> dataSurface =
|
||||||
surface->GetDataSurface();
|
surface->GetDataSurface();
|
||||||
|
if (!dataSurface) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
size_t length;
|
size_t length;
|
||||||
int32_t stride;
|
int32_t stride;
|
||||||
mozilla::UniquePtr<char[]> surfaceData =
|
mozilla::UniquePtr<char[]> surfaceData =
|
||||||
|
@ -1001,6 +1001,10 @@ PuppetWidget::SetCursor(imgIContainer* aCursor,
|
|||||||
|
|
||||||
RefPtr<mozilla::gfx::DataSourceSurface> dataSurface =
|
RefPtr<mozilla::gfx::DataSourceSurface> dataSurface =
|
||||||
surface->GetDataSurface();
|
surface->GetDataSurface();
|
||||||
|
if (!dataSurface) {
|
||||||
|
return NS_ERROR_FAILURE;
|
||||||
|
}
|
||||||
|
|
||||||
size_t length;
|
size_t length;
|
||||||
int32_t stride;
|
int32_t stride;
|
||||||
mozilla::UniquePtr<char[]> surfaceData =
|
mozilla::UniquePtr<char[]> surfaceData =
|
||||||
|
@ -51,20 +51,21 @@ nsDragServiceProxy::InvokeDragSessionImpl(nsISupportsArray* aArrayTransferables,
|
|||||||
RefPtr<mozilla::gfx::DataSourceSurface> dataSurface =
|
RefPtr<mozilla::gfx::DataSourceSurface> dataSurface =
|
||||||
surface->GetDataSurface();
|
surface->GetDataSurface();
|
||||||
mozilla::gfx::IntSize size = dataSurface->GetSize();
|
mozilla::gfx::IntSize size = dataSurface->GetSize();
|
||||||
|
if (dataSurface) {
|
||||||
|
size_t length;
|
||||||
|
int32_t stride;
|
||||||
|
mozilla::UniquePtr<char[]> surfaceData =
|
||||||
|
nsContentUtils::GetSurfaceData(dataSurface, &length, &stride);
|
||||||
|
nsDependentCString dragImage(surfaceData.get(), length);
|
||||||
|
|
||||||
size_t length;
|
mozilla::Unused <<
|
||||||
int32_t stride;
|
child->SendInvokeDragSession(dataTransfers, aActionType, dragImage,
|
||||||
mozilla::UniquePtr<char[]> surfaceData =
|
size.width, size.height, stride,
|
||||||
nsContentUtils::GetSurfaceData(dataSurface, &length, &stride);
|
static_cast<uint8_t>(dataSurface->GetFormat()),
|
||||||
nsDependentCString dragImage(surfaceData.get(), length);
|
dragRect.x, dragRect.y);
|
||||||
|
StartDragSession();
|
||||||
mozilla::Unused <<
|
return NS_OK;
|
||||||
child->SendInvokeDragSession(dataTransfers, aActionType, dragImage,
|
}
|
||||||
size.width, size.height, stride,
|
|
||||||
static_cast<uint8_t>(dataSurface->GetFormat()),
|
|
||||||
dragRect.x, dragRect.y);
|
|
||||||
StartDragSession();
|
|
||||||
return NS_OK;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user