diff options
Diffstat (limited to 'indra/llimage/llimagebmp.cpp')
-rw-r--r-- | indra/llimage/llimagebmp.cpp | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/indra/llimage/llimagebmp.cpp b/indra/llimage/llimagebmp.cpp index 08fcdf39da..2a328675c2 100644 --- a/indra/llimage/llimagebmp.cpp +++ b/indra/llimage/llimagebmp.cpp @@ -96,6 +96,8 @@ bool LLImageBMP::updateData() { resetLastError(); + LLImageDataLock lock(this); + // Check to make sure that this instance has been initialized with data U8* mdata = getData(); if (!mdata || (0 == getDataSize())) @@ -337,8 +339,11 @@ bool LLImageBMP::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 - U8* mdata = getData(); + const U8* mdata = getData(); if (!mdata || (0 == getDataSize())) { setLastError("llimagebmp trying to decode an image with no data!"); @@ -351,7 +356,7 @@ bool LLImageBMP::decode(LLImageRaw* raw_image, F32 decode_time) return false; } - U8* src = mdata + mBitmapOffset; + const U8* src = mdata + mBitmapOffset; U8* dst = raw_image->getData(); bool success = false; @@ -398,7 +403,7 @@ U32 LLImageBMP::countTrailingZeros( U32 m ) } -bool LLImageBMP::decodeColorMask16( U8* dst, U8* src ) +bool LLImageBMP::decodeColorMask16( U8* dst, const U8* src ) { llassert( 16 == mBitsPerPixel ); @@ -434,7 +439,7 @@ bool LLImageBMP::decodeColorMask16( U8* dst, U8* src ) return true; } -bool LLImageBMP::decodeColorMask32( U8* dst, U8* src ) +bool LLImageBMP::decodeColorMask32( U8* dst, const U8* src ) { // Note: alpha is not supported @@ -478,7 +483,7 @@ bool LLImageBMP::decodeColorMask32( U8* dst, U8* src ) } -bool LLImageBMP::decodeColorTable8( U8* dst, U8* src ) +bool LLImageBMP::decodeColorTable8( U8* dst, const U8* src ) { llassert( (8 == mBitsPerPixel) && (mColorPaletteColors >= 256) ); @@ -508,7 +513,7 @@ bool LLImageBMP::decodeColorTable8( U8* dst, U8* src ) } -bool LLImageBMP::decodeTruecolor24( U8* dst, U8* src ) +bool LLImageBMP::decodeTruecolor24( U8* dst, const U8* src ) { llassert( 24 == mBitsPerPixel ); llassert( 3 == getComponents() ); @@ -542,6 +547,9 @@ bool LLImageBMP::encode(const LLImageRaw* raw_image, F32 encode_time) resetLastError(); + LLImageDataSharedLock lockIn(raw_image); + LLImageDataLock lockOut(this); + S32 src_components = raw_image->getComponents(); S32 dst_components = ( src_components < 3 ) ? 1 : 3; |