Commit 57801af4 authored by Xida Chen's avatar Xida Chen Committed by Commit Bot

Fix float-cast overflow in css_color_interpolation_type.cc

This is due to implicit cast from double to int, add static_cast would
fix it.

Bug: 904333
Change-Id: I91a5120e67cd5e2eab7d0ea373b826cc3cbff104
Reviewed-on: https://chromium-review.googlesource.com/c/1350331Reviewed-by: default avatarStephen McGruer <smcgruer@chromium.org>
Commit-Queue: Xida Chen <xidachen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#611161}
parent 25670014
...@@ -159,8 +159,10 @@ Color CSSColorInterpolationType::ResolveInterpolableColor( ...@@ -159,8 +159,10 @@ Color CSSColorInterpolationType::ResolveInterpolableColor(
if (alpha == 0) if (alpha == 0)
return Color::kTransparent; return Color::kTransparent;
return MakeRGBA(round(red / alpha), round(green / alpha), round(blue / alpha), return MakeRGBA(static_cast<int>(round(red / alpha)),
round(alpha)); static_cast<int>(round(green / alpha)),
static_cast<int>(round(blue / alpha)),
static_cast<int>(round(alpha)));
} }
class InheritedColorChecker class InheritedColorChecker
......
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