summaryrefslogtreecommitdiff
path: root/indra/newview/lltexlayer.cpp
diff options
context:
space:
mode:
authorWilliam Todd Stinson <stinson@lindenlab.com>2012-10-18 16:51:23 -0700
committerWilliam Todd Stinson <stinson@lindenlab.com>2012-10-18 16:51:23 -0700
commit4db36dfcdca29eefee618cbfe318e9d6fea16c7b (patch)
treee2921ff30e2b294ac4d726a083c0225902494ecc /indra/newview/lltexlayer.cpp
parent52e306d575b38cb80fcda38efa83be32c251766b (diff)
parent7021e4b21b3f2ec7007f34f94bc9825949722d5b (diff)
Pull and merge from https://bitbucket.org/lindenlab/viewer-development.
Diffstat (limited to 'indra/newview/lltexlayer.cpp')
-rw-r--r--indra/newview/lltexlayer.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/indra/newview/lltexlayer.cpp b/indra/newview/lltexlayer.cpp
index 467115c928..ad09af6594 100644
--- a/indra/newview/lltexlayer.cpp
+++ b/indra/newview/lltexlayer.cpp
@@ -510,7 +510,13 @@ void LLTexLayerSetBuffer::doUpload()
BOOL valid = FALSE;
LLPointer<LLImageJ2C> integrity_test = new LLImageJ2C;
S32 file_size = 0;
- U8* data = LLVFile::readFile(gVFS, asset_id, LLAssetType::AT_TEXTURE, &file_size);
+
+ //data buffer MUST be allocated using LLImageBase
+ LLVFile file(gVFS, asset_id, LLAssetType::AT_TEXTURE);
+ file_size = file.getSize();
+ U8* data = integrity_test->allocateData(file_size);
+ file.read(data, file_size);
+
if (data)
{
valid = integrity_test->validate(data, file_size); // integrity_test will delete 'data'