diff options
| author | maksymsproductengine <maksymsproductengine@lindenlab.com> | 2014-03-20 19:21:52 +0200 |
|---|---|---|
| committer | maksymsproductengine <maksymsproductengine@lindenlab.com> | 2014-03-20 19:21:52 +0200 |
| commit | 6f33f9090b554a32f039e46d8177650ccbf94536 (patch) | |
| tree | 3d518c0a2ec73a88c5cd0c99d900e98c035b8756 /indra/newview/llworld.cpp | |
| parent | 2f606a36f63979af73bad76d883646b2d3f8a727 (diff) | |
MAINT-3827 FIXED crash in KDU texture decoding, likely out of memory
Diffstat (limited to 'indra/newview/llworld.cpp')
| -rwxr-xr-x | indra/newview/llworld.cpp | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/indra/newview/llworld.cpp b/indra/newview/llworld.cpp index 85614f397c..27256af97a 100755 --- a/indra/newview/llworld.cpp +++ b/indra/newview/llworld.cpp @@ -101,15 +101,21 @@ LLWorld::LLWorld() : LLPointer<LLImageRaw> raw = new LLImageRaw(1,1,4); U8 *default_texture = raw->getData(); - *(default_texture++) = MAX_WATER_COLOR.mV[0]; - *(default_texture++) = MAX_WATER_COLOR.mV[1]; - *(default_texture++) = MAX_WATER_COLOR.mV[2]; - *(default_texture++) = MAX_WATER_COLOR.mV[3]; - - mDefaultWaterTexturep = LLViewerTextureManager::getLocalTexture(raw.get(), FALSE); - gGL.getTexUnit(0)->bind(mDefaultWaterTexturep); - mDefaultWaterTexturep->setAddressMode(LLTexUnit::TAM_CLAMP); + if (default_texture) + { + *(default_texture++) = MAX_WATER_COLOR.mV[0]; + *(default_texture++) = MAX_WATER_COLOR.mV[1]; + *(default_texture++) = MAX_WATER_COLOR.mV[2]; + *(default_texture++) = MAX_WATER_COLOR.mV[3]; + } + + if (mDefaultWaterTexturep) + { + mDefaultWaterTexturep = LLViewerTextureManager::getLocalTexture(raw.get(), FALSE); + gGL.getTexUnit(0)->bind(mDefaultWaterTexturep); + mDefaultWaterTexturep->setAddressMode(LLTexUnit::TAM_CLAMP); + } } |
