Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(11)

Unified Diff: cc/tiles/software_image_decode_cache.cc

Issue 2908143005: cc: Allow SkImage::makeColorSpace to fail (Closed)
Patch Set: cc: Allow SkImage::makeColorSpace to fail Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/tiles/software_image_decode_cache.cc
diff --git a/cc/tiles/software_image_decode_cache.cc b/cc/tiles/software_image_decode_cache.cc
index c41e24024e3d87acb48c2c6046e747fe6e196e79..f84ed1d8997dc0310397ae9fe1bfaca2069c7b46 100644
--- a/cc/tiles/software_image_decode_cache.cc
+++ b/cc/tiles/software_image_decode_cache.cc
@@ -587,7 +587,12 @@ SoftwareImageDecodeCache::GetOriginalSizeImageDecode(
"color conversion");
image = image->makeColorSpace(target_color_space,
SkTransferFunctionBehavior::kIgnore);
- DCHECK(image);
+ // Because image is a lazy-decode image, the call to makeColorSpace will
+ // fail if image decode fails.
+ if (!image) {
+ decoded_pixels->Unlock();
+ return nullptr;
+ }
}
{
TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("cc.debug"),
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698