summaryrefslogtreecommitdiffstats
path: root/layout/generic/nsImageMap.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'layout/generic/nsImageMap.cpp')
-rw-r--r--layout/generic/nsImageMap.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/layout/generic/nsImageMap.cpp b/layout/generic/nsImageMap.cpp
index 8ddd9338f2..ce621fb6be 100644
--- a/layout/generic/nsImageMap.cpp
+++ b/layout/generic/nsImageMap.cpp
@@ -467,7 +467,7 @@ void PolyArea::Draw(nsIFrame* aFrame, DrawTarget& aDrawTarget,
Point p1(pc->CSSPixelsToDevPixels(mCoords[0]),
pc->CSSPixelsToDevPixels(mCoords[1]));
Point p2, p1snapped, p2snapped;
- for (int32_t i = 2; i < mNumCoords; i += 2) {
+ for (int32_t i = 2; i < mNumCoords - 1; i += 2) {
p2.x = pc->CSSPixelsToDevPixels(mCoords[i]);
p2.y = pc->CSSPixelsToDevPixels(mCoords[i + 1]);
p1snapped = p1;
@@ -493,7 +493,7 @@ void PolyArea::GetRect(nsIFrame* aFrame, nsRect& aRect) {
nscoord x1, x2, y1, y2, xtmp, ytmp;
x1 = x2 = nsPresContext::CSSPixelsToAppUnits(mCoords[0]);
y1 = y2 = nsPresContext::CSSPixelsToAppUnits(mCoords[1]);
- for (int32_t i = 2; i < mNumCoords; i += 2) {
+ for (int32_t i = 2; i < mNumCoords - 1; i += 2) {
xtmp = nsPresContext::CSSPixelsToAppUnits(mCoords[i]);
ytmp = nsPresContext::CSSPixelsToAppUnits(mCoords[i + 1]);
x1 = x1 < xtmp ? x1 : xtmp;