diff options
author | Sabrina Shanman <cosmic@lindenlab.com> | 2022-07-27 18:25:37 +0000 |
---|---|---|
committer | Sabrina Shanman <cosmic@lindenlab.com> | 2022-07-27 18:25:37 +0000 |
commit | eba7ae24dc00725909aea0ede7c8b3d3f4394017 (patch) | |
tree | a10c0d7c94eaf6736627d78dbbee7ae0562995e6 | |
parent | 9664eb86339f1cffac51cd0a5339535a040cada5 (diff) | |
parent | 1521221e56de368a3b28c170a1e69e3c7dde7507 (diff) |
Merged in SL-17826 (pull request #1077)
SL-17826: Fix index out of bounds in mOwnership when drawing parcel lines
Approved-by: Andrey Kleshchev
Approved-by: Andrey Lihatskiy
-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)); |