Commit b03f5cf6 authored by Justin Novosad's avatar Justin Novosad Committed by Commit Bot

Add null checks in CanvasResourceProvider::Create

Null ptr checks were missing on context_provider_wrapper, resulting
in crashes after a GPU context loss.

BUG=863752

Cq-Include-Trybots: luci.chromium.try:linux_layout_tests_slimming_paint_v2;master.tryserver.blink:linux_trusty_blink_rel
Change-Id: I4b6f1fc394deb3f5567fee1da6f74b66aa7db79d
Reviewed-on: https://chromium-review.googlesource.com/1140282Reviewed-by: default avatarFernando Serboncini <fserb@chromium.org>
Commit-Queue: Justin Novosad <junov@chromium.org>
Cr-Commit-Position: refs/heads/master@{#575674}
parent d25f6810
......@@ -420,6 +420,8 @@ std::unique_ptr<CanvasResourceProvider> CanvasResourceProvider::Create(
if (presentation_mode !=
CanvasResourceProvider::kAllowImageChromiumPresentationMode)
continue;
if (!context_provider_wrapper)
continue;
if (!gpu::IsImageFromGpuMemoryBufferFormatSupported(
color_params.GetBufferFormat(),
context_provider_wrapper->ContextProvider()
......@@ -454,6 +456,8 @@ std::unique_ptr<CanvasResourceProvider> CanvasResourceProvider::Create(
size, color_params, resource_dispatcher);
break;
case kTextureResourceType:
if (!context_provider_wrapper)
continue;
provider = std::make_unique<CanvasResourceProviderTexture>(
size, msaa_sample_count, color_params, context_provider_wrapper,
resource_dispatcher);
......
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