summaryrefslogtreecommitdiff
path: root/indra/llimage/llimagejpeg.cpp
diff options
context:
space:
mode:
authorErik Kundiman <erik@megapahit.org>2024-07-27 15:17:57 +0800
committerErik Kundiman <erik@megapahit.org>2024-07-28 08:24:59 +0800
commit96a81b5ecbe3bffb582ded930752c0523df5e80a (patch)
treea87a0bd09fd980562e88150dbfea3819d28d9f12 /indra/llimage/llimagejpeg.cpp
parent06e8f0c443c1ba7858d000c6d695b7e988e02053 (diff)
parented73208eb96b862b97fa285036edea1e792ca3c6 (diff)
Merge remote-tracking branch 'secondlife/release/2024.06-atlasaurus' into 2024.06-atlasaurus
Diffstat (limited to 'indra/llimage/llimagejpeg.cpp')
-rw-r--r--indra/llimage/llimagejpeg.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/indra/llimage/llimagejpeg.cpp b/indra/llimage/llimagejpeg.cpp
index 93f1d0cdc4..0e7ec365d4 100644
--- a/indra/llimage/llimagejpeg.cpp
+++ b/indra/llimage/llimagejpeg.cpp
@@ -50,6 +50,8 @@ bool LLImageJPEG::updateData()
{
resetLastError();
+ LLImageDataLock lock(this);
+
// Check to make sure that this instance has been initialized with data
if (!getData() || (0 == getDataSize()))
{
@@ -189,6 +191,9 @@ bool LLImageJPEG::decode(LLImageRaw* raw_image, F32 decode_time)
resetLastError();
+ LLImageDataLock lockIn(this);
+ LLImageDataLock lockOut(raw_image);
+
// Check to make sure that this instance has been initialized with data
if (!getData() || (0 == getDataSize()))
{
@@ -408,6 +413,8 @@ void LLImageJPEG::encodeTermDestination( j_compress_ptr cinfo )
{
LLImageJPEG* self = (LLImageJPEG*) cinfo->client_data;
+ LLImageDataLock lock(self);
+
S32 file_bytes = (S32)(self->mOutputBufferSize - cinfo->dest->free_in_buffer);
self->allocateData(file_bytes);
@@ -484,6 +491,9 @@ bool LLImageJPEG::encode( const LLImageRaw* raw_image, F32 encode_time )
resetLastError();
+ LLImageDataSharedLock lockIn(raw_image);
+ LLImageDataLock lockOut(this);
+
switch( raw_image->getComponents() )
{
case 1: