Commit ed208302 authored by Xianzhu Wang's avatar Xianzhu Wang Committed by Commit Bot

[PE] Avoid integer overflow in WebPluginContainerImpl::Paint()

Bug: 822190
Change-Id: I63fd40f80f243dbf4a40baac940f2dd999d3e443
Reviewed-on: https://chromium-review.googlesource.com/964541Reviewed-by: default avatarPhilip Rogers <pdr@chromium.org>
Commit-Queue: Xianzhu Wang <wangxianzhu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#544184}
parent 809507f6
......@@ -188,10 +188,9 @@ void WebPluginContainerImpl::Paint(GraphicsContext& context,
// The plugin is positioned in the root frame's coordinates, so it needs to
// be painted in them too.
IntPoint origin = ParentFrameView().ContentsToRootFrame(IntPoint(0, 0));
origin -= paint_offset;
context.Translate(static_cast<float>(-origin.X()),
static_cast<float>(-origin.Y()));
FloatPoint origin(ParentFrameView().ContentsToRootFrame(IntPoint()));
origin.Move(-paint_offset);
context.Translate(-origin.X(), -origin.Y());
WebCanvas* canvas = context.Canvas();
......
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