Commit 25d0ca27 authored by Robbie Gibson's avatar Robbie Gibson Committed by Commit Bot

Prevent calling MakeThreadSafe on null ImageSkia

It is unclear why the CHECK in MakeThreadSafe is getting hit, but this
should prevent that. This case should be caught by the existing
if (!optional_image) checks, but apparently is not.

Bug: 1136759
Change-Id: Ia38f25df99c0f39fcdc002bb78ec447fdc4e58cf
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2484701
Commit-Queue: Robbie Gibson <rkgibson@google.com>
Reviewed-by: default avatarJustin Donnelly <jdonnelly@chromium.org>
Cr-Commit-Position: refs/heads/master@{#818504}
parent 4c7bf9d4
......@@ -552,7 +552,10 @@ void ClipboardProvider::NewClipboardImageMatch(
void ClipboardProvider::OnReceiveImage(
ClipboardImageMatchCallback callback,
base::Optional<gfx::Image> optional_image) {
if (!optional_image) {
// ImageSkia::ToImageSkia should only be called if the gfx::Image is
// non-empty. It is unclear when the clipboard returns a non-optional but
// empty image. See crbug.com/1136759 for more details.
if (!optional_image || optional_image.value().IsEmpty()) {
std::move(callback).Run(base::nullopt);
return;
}
......
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