Commit 62e2fc7f authored by sievers's avatar sievers Committed by Commit bot

Android: Fix potential null-ptr deref

BrowserGpuChannelHostFactory::GetGpuChannel() can
return NULL. In particular it already checks
IsLost() and returns NULL if that is the case.

BUG=445945

Review URL: https://codereview.chromium.org/867093004

Cr-Commit-Position: refs/heads/master@{#314683}
parent e01484c0
...@@ -158,8 +158,7 @@ GLHelperHolder::CreateContext3D() { ...@@ -158,8 +158,7 @@ GLHelperHolder::CreateContext3D() {
scoped_refptr<GpuChannelHost> gpu_channel_host(factory->GetGpuChannel()); scoped_refptr<GpuChannelHost> gpu_channel_host(factory->GetGpuChannel());
// GLHelper can only be used in asynchronous APIs for postprocessing after // GLHelper can only be used in asynchronous APIs for postprocessing after
// Browser Compositor operations (i.e. readback). // Browser Compositor operations (i.e. readback).
DCHECK(gpu_channel_host.get()) << "Illegal access to GPU channel at startup"; if (!gpu_channel_host.get()) {
if (gpu_channel_host->IsLost()) {
// The Browser Compositor is in charge of reestablishing the channel. // The Browser Compositor is in charge of reestablishing the channel.
return scoped_ptr<WebGraphicsContext3DCommandBufferImpl>(); return scoped_ptr<WebGraphicsContext3DCommandBufferImpl>();
} }
......
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