From a7c14e2f29831f4bc5eb18e23e55eb6f7a4e3431 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Mon, 8 Apr 2024 17:12:12 +0200 Subject: Merging upstream version 115.8.0esr. Signed-off-by: Daniel Baumann --- layout/generic/nsImageMap.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'layout/generic/nsImageMap.cpp') 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; -- cgit v1.2.3