summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorCosmic Linden <cosmic@lindenlab.com>2022-07-26 11:31:01 -0700
committerCosmic Linden <cosmic@lindenlab.com>2022-07-26 15:17:50 -0700
commit1521221e56de368a3b28c170a1e69e3c7dde7507 (patch)
treecdb70135b94eec08be4061a740cdc162b4b83bae /indra
parentbb318110efaa7161015be4228d985e49aefec8f8 (diff)
SL-17826: Fix index out of bounds in mOwnership when drawing parcel lines
Diffstat (limited to 'indra')
-rwxr-xr-xindra/newview/llviewerparceloverlay.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/indra/newview/llviewerparceloverlay.cpp b/indra/newview/llviewerparceloverlay.cpp
index 31587549e8..785c84c38d 100755
--- a/indra/newview/llviewerparceloverlay.cpp
+++ b/indra/newview/llviewerparceloverlay.cpp
@@ -1068,13 +1068,14 @@ void LLViewerParcelOverlay::renderPropertyLinesOnMinimap(F32 scale_pixels_per_me
gGL.color4fv(parcel_outline_color);
for (S32 i = 0; i < GRIDS_PER_EDGE + 1; i++)
{
- F32 bottom = region_bottom + (i * map_parcel_width);
- F32 top = bottom + map_parcel_width;
+ const F32 bottom = region_bottom + (i * map_parcel_width);
+ const F32 top = bottom + map_parcel_width;
for (S32 j = 0; j < GRIDS_PER_EDGE + 1; j++)
{
- F32 left = region_left + (j * map_parcel_width);
- F32 right = left + map_parcel_width;
- U8 overlay = mOwnership[(i * GRIDS_PER_EDGE) + j];
+ const F32 left = region_left + (j * map_parcel_width);
+ const F32 right = left + map_parcel_width;
+ const bool is_region_boundary = i == GRIDS_PER_EDGE || j == GRIDS_PER_EDGE;
+ const U8 overlay = is_region_boundary ? 0 : mOwnership[(i * GRIDS_PER_EDGE) + j];
// The property line vertices are three-dimensional, but here we only care about the x and y coordinates, as we are drawing on a
// 2D map
const bool has_left = i != GRIDS_PER_EDGE && (j == GRIDS_PER_EDGE || (overlay & PARCEL_WEST_LINE));