From 82e6e42b9ee62af0e39049e3d789457fe1a41281 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Tue, 12 Aug 2025 22:13:51 +0300 Subject: #4527 Crash trying to upload a huge image Raw image permits only a 256 MB buffer so this isn't unexpected. --- indra/llimagej2coj/llimagej2coj.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'indra/llimagej2coj/llimagej2coj.cpp') diff --git a/indra/llimagej2coj/llimagej2coj.cpp b/indra/llimagej2coj/llimagej2coj.cpp index c56e94aaa4..431f5aa001 100644 --- a/indra/llimagej2coj/llimagej2coj.cpp +++ b/indra/llimagej2coj/llimagej2coj.cpp @@ -897,6 +897,12 @@ bool LLImageJ2COJ::decodeImpl(LLImageJ2C &base, LLImageRaw &raw_image, F32 decod bool LLImageJ2COJ::encodeImpl(LLImageJ2C &base, const LLImageRaw &raw_image, const char* comment_text, F32 encode_time, bool reversible) { + if (raw_image.isBufferInvalid()) + { + base.setLastError("Invalid input, no buffer"); + return false; + } + JPEG2KEncode encode(comment_text, reversible); bool encoded = encode.encode(raw_image, base); if (!encoded) -- cgit v1.2.3