Commit 0d60e31c authored by Brian Osman's avatar Brian Osman Committed by Commit Bot

Limit color space xform formats to the valid range in fuzzing

There are only 7 ColorFormat values.

Bug: chromium:842483
Change-Id: I92e10ed9147b8df607fd5ea62e9a0a5f2300c14c
Reviewed-on: https://chromium-review.googlesource.com/1057452Reviewed-by: default avatarMike Klein <mtklein@google.com>
Reviewed-by: default avatarMike Klein <mtklein@chromium.org>
Reviewed-by: default avatarJonathan Metzman <metzman@chromium.org>
Commit-Queue: Brian Osman <brianosman@google.com>
Cr-Commit-Position: refs/heads/master@{#558351}
parent 974a1329
...@@ -37,8 +37,8 @@ static void ColorTransform(size_t hash, bool input) { ...@@ -37,8 +37,8 @@ static void ColorTransform(size_t hash, bool input) {
static uint32_t output[kPixels * 4]; static uint32_t output[kPixels * 4];
const auto form1 = SkColorSpaceXform::ColorFormat(hash >> 0 & 7); const auto form1 = SkColorSpaceXform::ColorFormat((hash >> 0) % 7);
const auto form2 = SkColorSpaceXform::ColorFormat(hash >> 3 & 7); const auto form2 = SkColorSpaceXform::ColorFormat((hash >> 3) % 7);
const auto alpha = SkAlphaType(hash >> 6 & 3); const auto alpha = SkAlphaType(hash >> 6 & 3);
transform->apply(form1, output, form2, pixels, kPixels, alpha); transform->apply(form1, output, form2, pixels, kPixels, alpha);
......
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