summaryrefslogtreecommitdiff
path: root/indra/newview/llviewerparceloverlay.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llviewerparceloverlay.cpp')
-rwxr-xr-xindra/newview/llviewerparceloverlay.cpp20
1 files changed, 13 insertions, 7 deletions
diff --git a/indra/newview/llviewerparceloverlay.cpp b/indra/newview/llviewerparceloverlay.cpp
index a1c12c5cd6..fad77bce25 100755
--- a/indra/newview/llviewerparceloverlay.cpp
+++ b/indra/newview/llviewerparceloverlay.cpp
@@ -76,10 +76,13 @@ LLViewerParcelOverlay::LLViewerParcelOverlay(LLViewerRegion* region, F32 region_
//
// Create the base texture.
U8 *raw = mImageRaw->getData();
- const S32 COUNT = mParcelGridsPerEdge * mParcelGridsPerEdge * OVERLAY_IMG_COMPONENTS;
- for (S32 i = 0; i < COUNT; i++)
+ if (raw)
{
- raw[i] = 0;
+ const S32 COUNT = mParcelGridsPerEdge * mParcelGridsPerEdge * OVERLAY_IMG_COMPONENTS;
+ for (S32 i = 0; i < COUNT; i++)
+ {
+ raw[i] = 0;
+ }
}
//mTexture->setSubImage(mImageRaw, 0, 0, mParcelGridsPerEdge, mParcelGridsPerEdge);
@@ -380,10 +383,13 @@ void LLViewerParcelOverlay::updateOverlayTexture()
break;
}
- raw[pixel_index + 0] = (U8)r;
- raw[pixel_index + 1] = (U8)g;
- raw[pixel_index + 2] = (U8)b;
- raw[pixel_index + 3] = (U8)a;
+ if (raw)
+ {
+ raw[pixel_index + 0] = (U8)r;
+ raw[pixel_index + 1] = (U8)g;
+ raw[pixel_index + 2] = (U8)b;
+ raw[pixel_index + 3] = (U8)a;
+ }
pixel_index += OVERLAY_IMG_COMPONENTS;
}