Commit fb0d82a4 authored by Khushal's avatar Khushal Committed by Commit Bot

cc: Fix flags access in ScopedRasterFlags.

If an image fails to decode on a shader, abort early instead of trying
to decode the flags further. Since Flags() returns nullptr based on
whether the decode failed, it was causing crashes.

R=enne@chromium.org

Bug: 824068,824058
Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel;master.tryserver.blink:linux_trusty_blink_rel
Change-Id: I1040598df19c94a10a71a5b494f196abfffee2ab
Reviewed-on: https://chromium-review.googlesource.com/974480Reviewed-by: default avatarenne <enne@chromium.org>
Commit-Queue: Khushal <khushalsagar@chromium.org>
Cr-Commit-Position: refs/heads/master@{#544945}
parent c4b54ebc
......@@ -20,11 +20,15 @@ ScopedRasterFlags::ScopedRasterFlags(const PaintFlags* flags,
// a mess. We decode image shaders at the correct scale but ignore that
// during serialization and just use the original image.
decode_stashing_image_provider_.emplace(image_provider);
// We skip the op if any images fail to decode.
DecodeImageShader(ctm);
if (decode_failed_)
return;
DecodeRecordShader(ctm, create_skia_shader);
if (decode_failed_)
return;
DecodeFilter();
// We skip the op if any images fail to decode.
if (decode_failed_)
return;
}
......
......@@ -38,6 +38,7 @@ class CC_PAINT_EXPORT ScopedRasterFlags {
void DecodeImageShader(const SkMatrix& ctm);
void DecodeRecordShader(const SkMatrix& ctm, bool create_skia_shader);
void DecodeFilter();
void AdjustStrokeIfNeeded(const SkMatrix& ctm);
PaintFlags* MutableFlags() {
......
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