Commit 9d224b20 authored by Kai Ninomiya's avatar Kai Ninomiya Committed by Commit Bot

Null-check ImageBitmap's SkImage in texImage2D

This should guard against a crash.
It's not clear exactly what the cause of this null is, but it's
probably some kind of failure to allocate the SkImage (e.g.
out-of-memory, GPU process loss, or other unpredictable failure case).

Bug: 852303
Change-Id: I10a817f2dccd801f5834be343ad687af09e06721
Reviewed-on: https://chromium-review.googlesource.com/1188515Reviewed-by: default avatarKenneth Russell <kbr@chromium.org>
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
Cr-Commit-Position: refs/heads/master@{#586085}
parent ef4a7dd5
......@@ -5594,8 +5594,15 @@ void WebGLRenderingContextBase::TexImageHelperImageBitmap(
}
return;
}
sk_sp<SkImage> sk_image =
bitmap->BitmapImage()->PaintImageForCurrentFrame().GetSkImage();
if (!sk_image) {
SynthesizeGLError(GL_OUT_OF_MEMORY, func_name,
"ImageBitmap unexpectedly empty");
return;
}
SkPixmap pixmap;
uint8_t* pixel_data_ptr = nullptr;
scoped_refptr<Uint8Array> pixel_data;
......
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