summaryrefslogtreecommitdiff
path: root/indra/llrender/llfontfreetype.cpp
diff options
context:
space:
mode:
authorNicky <nicky.dasmijn@posteo.nl>2024-10-02 13:55:27 +0200
committerNicky <nicky.dasmijn@posteo.nl>2024-10-02 13:56:06 +0200
commitc68e81ce59e6030a4f01da0095c8ba6e8385e91f (patch)
treeb0184f6fb3598d83b4fc419aba40d4d3fa8224c0 /indra/llrender/llfontfreetype.cpp
parentf2b10d095f52b6dd614f6a273024bd69d39b7685 (diff)
Add another static_cast<long> to make the implicit conversion from size_t > long explicit.
Diffstat (limited to 'indra/llrender/llfontfreetype.cpp')
-rw-r--r--indra/llrender/llfontfreetype.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/indra/llrender/llfontfreetype.cpp b/indra/llrender/llfontfreetype.cpp
index eee4ea988b..019fb07152 100644
--- a/indra/llrender/llfontfreetype.cpp
+++ b/indra/llrender/llfontfreetype.cpp
@@ -844,7 +844,8 @@ U8 const* LLFontManager::loadFont( std::string const &aFilename, long &a_Size)
if( itr != m_LoadedFonts.end() )
{
++itr->second->mRefs;
- a_Size = itr->second->mSize;
+ // A possible overflow cannot happen here, as it is asserted that the size is less than std::numeric_limits<long>::max() a few lines below.
+ a_Size = static_cast<long>(itr->second->mSize);
return reinterpret_cast<U8 const*>(itr->second->mAddress.c_str());
}