Commit af0a6ba1 authored by Wan-Teh Chang's avatar Wan-Teh Chang Committed by Commit Bot

Don't call SetEmbeddedColorProfile if null profile

Don't call SetEmbeddedColorProfile() if profile is a null pointer.
SetEmbeddedColorProfile() sets
source_to_target_color_transform_needs_update_ to true, which causes
extra work to be done when ColorTransform() is called later.

Change-Id: I63f1097547f168ce4522240c265de1caa8e01de6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2213449Reviewed-by: default avatarLeon Scroggins <scroggo@google.com>
Commit-Queue: Wan-Teh Chang <wtc@google.com>
Cr-Commit-Position: refs/heads/master@{#772432}
parent 78b6b132
...@@ -719,7 +719,8 @@ class JPEGImageReader final { ...@@ -719,7 +719,8 @@ class JPEGImageReader final {
profile = nullptr; profile = nullptr;
break; break;
} }
Decoder()->SetEmbeddedColorProfile(std::move(profile)); if (profile)
Decoder()->SetEmbeddedColorProfile(std::move(profile));
} else { } else {
DLOG(ERROR) << "Failed to parse image ICC profile"; DLOG(ERROR) << "Failed to parse image ICC profile";
} }
......
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