Commit eb89ff02 authored by Robert Phillips's avatar Robert Phillips Committed by Commit Bot

Improve paint op safety around reading SkBlendMode

Bug: 1116243
Change-Id: I9b0541a8bd3c8d4bd43744c1e082f86bfea6249a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2468698Reviewed-by: default avatarKhushal <khushalsagar@chromium.org>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Cr-Commit-Position: refs/heads/master@{#816714}
parent 065c9b6b
......@@ -265,7 +265,13 @@ void PaintOpReader::Read(PaintFlags* flags) {
ReadSimple(&flags->color_);
Read(&flags->width_);
Read(&flags->miter_limit_);
ReadSimple(&flags->blend_mode_);
if (flags->blend_mode_ > static_cast<uint32_t>(SkBlendMode::kLastMode)) {
SetInvalid();
return;
}
ReadSimple(&flags->bitfields_uint_);
ReadFlattenable(&flags->path_effect_);
......
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