MAINT-7633 Crash fix

master
Ansariel 2017-10-27 23:41:08 +02:00
parent 3978a5e3c6
commit 8084ccff3a
1 changed files with 2 additions and 2 deletions

View File

@ -1552,7 +1552,7 @@ LLPointer<LLImageRaw> LLImageRaw::scaled(S32 new_width, S32 new_height)
if ((old_width == new_width) && (old_height == new_height))
{
result = new LLImageRaw(old_width, old_height, components);
if (!result)
if (!result || result->isBufferInvalid())
{
LL_WARNS() << "Failed to allocate new image" << LL_ENDL;
return result;
@ -1566,7 +1566,7 @@ LLPointer<LLImageRaw> LLImageRaw::scaled(S32 new_width, S32 new_height)
if (new_data_size > 0)
{
result = new LLImageRaw(new_width, new_height, components);
if (!result)
if (!result || result->isBufferInvalid())
{
LL_WARNS() << "Failed to allocate new image" << LL_ENDL;
return result;