summaryrefslogtreecommitdiff
path: root/indra/llrender/llfontfreetype.cpp
diff options
context:
space:
mode:
authorErik Kundiman <erik@megapahit.org>2025-05-29 11:54:56 +0800
committerErik Kundiman <erik@megapahit.org>2025-05-29 11:54:56 +0800
commit11d75418fce8372e9976b069070d9d0506766d0d (patch)
treed0fc6b405dbcffefcd85f3ba52a8248c0128acde /indra/llrender/llfontfreetype.cpp
parentb6c3d47c007c59cbd3c9913a0b99f9d42bdb8d75 (diff)
parent0421e7b846b03d316740d759348c3aaa723d0b14 (diff)
Merge branch '2025.04'
Diffstat (limited to 'indra/llrender/llfontfreetype.cpp')
-rw-r--r--indra/llrender/llfontfreetype.cpp27
1 files changed, 23 insertions, 4 deletions
diff --git a/indra/llrender/llfontfreetype.cpp b/indra/llrender/llfontfreetype.cpp
index 2d8b8a0fee..41d0a1af31 100644
--- a/indra/llrender/llfontfreetype.cpp
+++ b/indra/llrender/llfontfreetype.cpp
@@ -656,7 +656,14 @@ LLFontGlyphInfo* LLFontFreetype::addGlyphFromFont(const LLFontFreetype *fontp, l
LLImageGL *image_gl = mFontBitmapCachep->getImageGL(bitmap_glyph_type, bitmap_num);
LLImageRaw *image_raw = mFontBitmapCachep->getImageRaw(bitmap_glyph_type, bitmap_num);
- image_gl->setSubImage(image_raw, 0, 0, image_gl->getWidth(), image_gl->getHeight());
+ if (image_gl && image_raw)
+ {
+ image_gl->setSubImage(image_raw, 0, 0, image_gl->getWidth(), image_gl->getHeight());
+ }
+ else
+ {
+ llassert(false); //images were just inserted by nextOpenPos, they shouldn't be missing
+ }
return gi;
}
@@ -840,7 +847,12 @@ bool LLFontFreetype::setSubImageBGRA(U32 x, U32 y, U32 bitmap_num, U16 width, U1
{
LLImageRaw* image_raw = mFontBitmapCachep->getImageRaw(EFontGlyphType::Color, bitmap_num);
llassert(!mIsFallback);
- llassert(image_raw && (image_raw->getComponents() == 4));
+ if (!image_raw)
+ {
+ llassert(false);
+ return false;
+ }
+ llassert(image_raw->getComponents() == 4);
// NOTE: inspired by LLImageRaw::setSubImage()
U32* image_data = (U32*)image_raw->getData();
@@ -868,10 +880,17 @@ bool LLFontFreetype::setSubImageBGRA(U32 x, U32 y, U32 bitmap_num, U16 width, U1
void LLFontFreetype::setSubImageLuminanceAlpha(U32 x, U32 y, U32 bitmap_num, U32 width, U32 height, U8 *data, S32 stride) const
{
LLImageRaw *image_raw = mFontBitmapCachep->getImageRaw(EFontGlyphType::Grayscale, bitmap_num);
- LLImageDataLock lock(image_raw);
llassert(!mIsFallback);
- llassert(image_raw && (image_raw->getComponents() == 2));
+ if (!image_raw)
+ {
+ llassert(false);
+ return;
+ }
+
+ LLImageDataLock lock(image_raw);
+
+ llassert(image_raw->getComponents() == 2);
U8 *target = image_raw->getData();
llassert(target);