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/llsurface.cpp | |
| parent | 2f606a36f63979af73bad76d883646b2d3f8a727 (diff) | |
MAINT-3827 FIXED crash in KDU texture decoding, likely out of memory
Diffstat (limited to 'indra/newview/llsurface.cpp')
| -rwxr-xr-x | indra/newview/llsurface.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/indra/newview/llsurface.cpp b/indra/newview/llsurface.cpp index 93c7f54101..f1b27279e3 100755 --- a/indra/newview/llsurface.cpp +++ b/indra/newview/llsurface.cpp @@ -233,6 +233,12 @@ void LLSurface::createSTexture() // GL NOT ACTIVE HERE LLPointer<LLImageRaw> raw = new LLImageRaw(sTextureSize, sTextureSize, 3); U8 *default_texture = raw->getData(); + + if (!default_texture) + { + return; + } + for (S32 i = 0; i < sTextureSize; i++) { for (S32 j = 0; j < sTextureSize; j++) @@ -257,6 +263,12 @@ void LLSurface::createWaterTexture() // Create the water texture LLPointer<LLImageRaw> raw = new LLImageRaw(sTextureSize/2, sTextureSize/2, 4); U8 *default_texture = raw->getData(); + + if (!default_texture) + { + return; + } + for (S32 i = 0; i < sTextureSize/2; i++) { for (S32 j = 0; j < sTextureSize/2; j++) |
