diff options
author | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2025-01-20 21:42:33 +0200 |
---|---|---|
committer | Andrey Kleshchev <117672381+akleshchev@users.noreply.github.com> | 2025-01-20 22:37:28 +0200 |
commit | fa963b6b15187739b808f16d42086e64aeebbacc (patch) | |
tree | d82e0325c653b377ba85ca8a05357c96649df42a | |
parent | 2ee845c02869b2b3db5810c9ad550efaa46a5289 (diff) |
#3438 Crash when ParcelProperties' Bitmap is of wrong size
-rw-r--r-- | indra/newview/llviewerparcelmgr.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/indra/newview/llviewerparcelmgr.cpp b/indra/newview/llviewerparcelmgr.cpp index 8c24b2438b..8e6657b4b9 100644 --- a/indra/newview/llviewerparcelmgr.cpp +++ b/indra/newview/llviewerparcelmgr.cpp @@ -1824,6 +1824,16 @@ void LLViewerParcelMgr::processParcelProperties(LLMessageSystem *msg, void **use S32 bitmap_size = parcel_mgr.mParcelsPerEdge * parcel_mgr.mParcelsPerEdge / 8; + S32 size = msg->getSizeFast(_PREHASH_ParcelData, _PREHASH_Bitmap); + if (size != bitmap_size) + { + // Might be better to ignore bitmap and drop highlights + LL_WARNS("ParcelMgr") << "Parcel Bitmap size expected: " << bitmap_size + << " actual " << size + << ". Bitmap might be corrupted!" << LL_ENDL; + bitmap_size = size; + } + U8* bitmap = new U8[ bitmap_size ]; msg->getBinaryDataFast(_PREHASH_ParcelData, _PREHASH_Bitmap, bitmap, bitmap_size); |