MAINT-6729 Additional fix for crash in LLImageGL::analyzeAlpha()
parent
c84d307676
commit
99d76f85f9
|
|
@ -817,7 +817,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()
|
||||
|
|
|
|||
|
|
@ -1275,6 +1275,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