Commit 22969b0f authored by Khushal Sagar's avatar Khushal Sagar Committed by Commit Bot

canvas2d: Handle resource allocation failure in CanvasResourceProvider.

A failure to allocate a CanvasResource should be handled safely.

R=fserb@chromium.org

Bug: 994979
Change-Id: I93303b7874a0286621344f7f9a6cdab9495e0919
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1772303
Auto-Submit: Khushal <khushalsagar@chromium.org>
Commit-Queue: Fernando Serboncini <fserb@chromium.org>
Reviewed-by: default avatarFernando Serboncini <fserb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#691624}
parent e5f87144
......@@ -663,7 +663,7 @@ class CanvasResourceProviderSharedImage : public CanvasResourceProvider {
sk_sp<SkSurface> CreateSkSurface() const override {
TRACE_EVENT0("blink", "CanvasResourceProviderSharedImage::CreateSkSurface");
if (IsGpuContextLost())
if (IsGpuContextLost() || !resource_)
return nullptr;
if (is_accelerated_) {
......
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