MAINT-6729 Additional fix for crash in LLImageGL::analyzeAlpha()
parent
2abd0eef41
commit
a65b586b18
|
|
@ -800,7 +800,7 @@ U8* LLImageBase::getData()
|
|||
return mData;
|
||||
}
|
||||
|
||||
bool LLImageBase::isBufferInvalid()
|
||||
bool LLImageBase::isBufferInvalid() const
|
||||
{
|
||||
return mBadBufferAllocation || mData == NULL ;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -141,7 +141,7 @@ public:
|
|||
|
||||
const U8 *getData() const ;
|
||||
U8 *getData() ;
|
||||
bool isBufferInvalid() ;
|
||||
bool isBufferInvalid() const;
|
||||
|
||||
void setSize(S32 width, S32 height, S32 ncomponents);
|
||||
U8* allocateDataSize(S32 width, S32 height, S32 ncomponents, S32 size = -1); // setSize() + allocateData()
|
||||
|
|
|
|||
|
|
@ -1267,6 +1267,12 @@ BOOL LLImageGL::createGLTexture(S32 discard_level, const LLImageRaw* imageraw, S
|
|||
llassert(gGLManager.mInited);
|
||||
stop_glerror();
|
||||
|
||||
if (!imageraw || imageraw->isBufferInvalid())
|
||||
{
|
||||
LL_WARNS() << "Trying to create a texture from invalid image data" << LL_ENDL;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (discard_level < 0)
|
||||
{
|
||||
llassert(mCurrentDiscardLevel >= 0);
|
||||
|
|
|
|||
Loading…
Reference in New Issue