summaryrefslogtreecommitdiff
path: root/indra/llimage/llimagedxt.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llimage/llimagedxt.cpp')
-rw-r--r--indra/llimage/llimagedxt.cpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/indra/llimage/llimagedxt.cpp b/indra/llimage/llimagedxt.cpp
index f75b1a72df..6b960f9077 100644
--- a/indra/llimage/llimagedxt.cpp
+++ b/indra/llimage/llimagedxt.cpp
@@ -176,6 +176,8 @@ bool LLImageDXT::updateData()
{
resetLastError();
+ LLImageDataLock lock(this);
+
U8* data = getData();
S32 data_size = getDataSize();
@@ -269,6 +271,9 @@ bool LLImageDXT::decode(LLImageRaw* raw_image, F32 time)
return false;
}
+ LLImageDataSharedLock lockIn(this);
+ LLImageDataLock lockOut(raw_image);
+
S32 width = getWidth(), height = getHeight();
S32 ncomponents = getComponents();
U8* data = NULL;
@@ -309,6 +314,9 @@ bool LLImageDXT::getMipData(LLPointer<LLImageRaw>& raw, S32 discard)
{
LL_ERRS() << "Request for invalid discard level" << LL_ENDL;
}
+
+ LLImageDataSharedLock lock(this);
+
U8* data = getData() + getMipOffset(discard);
S32 width = 0;
S32 height = 0;
@@ -339,6 +347,8 @@ bool LLImageDXT::encodeDXT(const LLImageRaw* raw_image, F32 time, bool explicit_
return 0;
}
+ LLImageDataLock lock(this);
+
S32 width = raw_image->getWidth();
S32 height = raw_image->getHeight();
@@ -430,6 +440,9 @@ bool LLImageDXT::convertToDXR()
return false;
}
mFileFormat = newformat;
+
+ LLImageDataLock lock(this);
+
S32 width = getWidth(), height = getHeight();
S32 nmips = calcNumMips(width,height);
S32 total_bytes = getDataSize();
@@ -463,7 +476,7 @@ bool LLImageDXT::convertToDXR()
// virtual
S32 LLImageDXT::calcHeaderSize()
{
- return llmax(sizeof(dxtfile_header_old_t), sizeof(dxtfile_header_t));
+ return static_cast<S32>(llmax(sizeof(dxtfile_header_old_t), sizeof(dxtfile_header_t)));
}
// virtual