diff options
author | Cosmic Linden <cosmic@lindenlab.com> | 2022-07-26 11:31:01 -0700 |
---|---|---|
committer | Cosmic Linden <cosmic@lindenlab.com> | 2022-07-26 15:17:50 -0700 |
commit | 1521221e56de368a3b28c170a1e69e3c7dde7507 (patch) | |
tree | cdb70135b94eec08be4061a740cdc162b4b83bae /indra/newview | |
parent | bb318110efaa7161015be4228d985e49aefec8f8 (diff) |
SL-17826: Fix index out of bounds in mOwnership when drawing parcel lines
Diffstat (limited to 'indra/newview')
-rwxr-xr-x | indra/newview/llviewerparceloverlay.cpp | 11 |
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)); |