summaryrefslogtreecommitdiff
path: root/indra/llrender
diff options
context:
space:
mode:
authormaksymsproductengine <maksymsproductengine@lindenlab.com>2014-03-20 19:21:52 +0200
committermaksymsproductengine <maksymsproductengine@lindenlab.com>2014-03-20 19:21:52 +0200
commit6f33f9090b554a32f039e46d8177650ccbf94536 (patch)
tree3d518c0a2ec73a88c5cd0c99d900e98c035b8756 /indra/llrender
parent2f606a36f63979af73bad76d883646b2d3f8a727 (diff)
MAINT-3827 FIXED crash in KDU texture decoding, likely out of memory
Diffstat (limited to 'indra/llrender')
-rwxr-xr-xindra/llrender/llcubemap.cpp5
-rwxr-xr-xindra/llrender/llfontfreetype.cpp15
-rwxr-xr-xindra/llrender/llimagegl.cpp5
3 files changed, 22 insertions, 3 deletions
diff --git a/indra/llrender/llcubemap.cpp b/indra/llrender/llcubemap.cpp
index 45a3b18179..0dad4285d9 100755
--- a/indra/llrender/llcubemap.cpp
+++ b/indra/llrender/llcubemap.cpp
@@ -116,6 +116,11 @@ void LLCubeMap::initRawData(const std::vector<LLPointer<LLImageRaw> >& rawimages
const U8 *sd = rawimages[i]->getData();
U8 *td = mRawImages[i]->getData();
+ if (!sd || !td)
+ {
+ continue;
+ }
+
S32 offset = 0;
S32 sx, sy, so;
for (int y = 0; y < 64; y++)
diff --git a/indra/llrender/llfontfreetype.cpp b/indra/llrender/llfontfreetype.cpp
index 84c782e958..7ab4e93da5 100755
--- a/indra/llrender/llfontfreetype.cpp
+++ b/indra/llrender/llfontfreetype.cpp
@@ -448,7 +448,11 @@ LLFontGlyphInfo* LLFontFreetype::addGlyphFromFont(const LLFontFreetype *fontp, l
LLImageGL *image_gl = mFontBitmapCachep->getImageGL(bitmap_num);
LLImageRaw *image_raw = mFontBitmapCachep->getImageRaw(bitmap_num);
- image_gl->setSubImage(image_raw, 0, 0, image_gl->getWidth(), image_gl->getHeight());
+
+ if (image_gl)
+ {
+ image_gl->setSubImage(image_raw, 0, 0, image_gl->getWidth(), image_gl->getHeight());
+ }
return gi;
}
@@ -560,13 +564,18 @@ void LLFontFreetype::setSubImageLuminanceAlpha(U32 x, U32 y, U32 bitmap_num, U32
{
LLImageRaw *image_raw = mFontBitmapCachep->getImageRaw(bitmap_num);
+ if (!image_raw)
+ {
+ return;
+ }
+
llassert(!mIsFallback);
- llassert(image_raw && (image_raw->getComponents() == 2));
+ llassert(image_raw->getComponents() == 2);
U8 *target = image_raw->getData();
- if (!data)
+ if (!data || !target)
{
return;
}
diff --git a/indra/llrender/llimagegl.cpp b/indra/llrender/llimagegl.cpp
index ab875141c5..315cc57e51 100755
--- a/indra/llrender/llimagegl.cpp
+++ b/indra/llrender/llimagegl.cpp
@@ -1251,6 +1251,11 @@ BOOL LLImageGL::createGLTexture(S32 discard_level, const LLImageRaw* imageraw, S
return FALSE;
}
+ if (!imageraw->getData())
+ {
+ return FALSE;
+ }
+
mGLTextureCreated = false ;
llassert(gGLManager.mInited);
stop_glerror();