summaryrefslogtreecommitdiff
path: root/indra/llimage
diff options
context:
space:
mode:
authorDave Houlton <euclid@lindenlab.com>2021-11-16 10:23:04 -0700
committerDave Houlton <euclid@lindenlab.com>2021-11-16 10:23:04 -0700
commit17f71efce08ed4e677b497f4734d6f9f1fef56a3 (patch)
tree8e27a7cb161f6e24439a772c5bcfdd4a3ee6f83a /indra/llimage
parente914f3e4a11ff86b3e05089c9b3a6677ec623c9c (diff)
parent9957c28ddc5e5c129af2db662da7d69f1509af65 (diff)
Merge branch 'master' v6.5.1 into DRTVWR-528
Diffstat (limited to 'indra/llimage')
-rw-r--r--indra/llimage/llimage.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/indra/llimage/llimage.cpp b/indra/llimage/llimage.cpp
index aed8943439..983c7c2406 100644
--- a/indra/llimage/llimage.cpp
+++ b/indra/llimage/llimage.cpp
@@ -1456,7 +1456,7 @@ bool LLImageRaw::scale( S32 new_width, S32 new_height, bool scale_image_data )
setDataAndSize(new_data, new_width, new_height, components);
}
}
- else
+ else try
{
// copy out existing image data
S32 temp_data_size = old_width * old_height * components;
@@ -1490,6 +1490,11 @@ bool LLImageRaw::scale( S32 new_width, S32 new_height, bool scale_image_data )
}
}
}
+ catch (std::bad_alloc&) // for temp_buffer
+ {
+ LL_WARNS() << "Failed to allocate temporary image buffer" << LL_ENDL;
+ return false;
+ }
return true ;
}