summaryrefslogtreecommitdiff
path: root/indra/llimage/llimagebmp.cpp
diff options
context:
space:
mode:
authorAndrey Kleshchev <andreykproductengine@lindenlab.com>2025-08-12 22:13:51 +0300
committerAndrey Kleshchev <117672381+akleshchev@users.noreply.github.com>2025-08-13 00:21:28 +0300
commit82e6e42b9ee62af0e39049e3d789457fe1a41281 (patch)
tree68c77257c8d33ffa00d9b09bd43ddaf95273fc6d /indra/llimage/llimagebmp.cpp
parent922d2324d06326602fdf5770bc555e3e9f90e74b (diff)
#4527 Crash trying to upload a huge image
Raw image permits only a 256 MB buffer so this isn't unexpected.
Diffstat (limited to 'indra/llimage/llimagebmp.cpp')
-rw-r--r--indra/llimage/llimagebmp.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/indra/llimage/llimagebmp.cpp b/indra/llimage/llimagebmp.cpp
index 2a328675c2..c8f99380ea 100644
--- a/indra/llimage/llimagebmp.cpp
+++ b/indra/llimage/llimagebmp.cpp
@@ -558,6 +558,12 @@ bool LLImageBMP::encode(const LLImageRaw* raw_image, F32 encode_time)
LL_INFOS() << "Dropping alpha information during BMP encoding" << LL_ENDL;
}
+ if (raw_image->isBufferInvalid())
+ {
+ setLastError("Invalid input, no buffer");
+ return false;
+ }
+
setSize(raw_image->getWidth(), raw_image->getHeight(), dst_components);
U8 magic[14];