From c97730988eccf10ce8a93e3f564d2b248b17abc8 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Mon, 15 Oct 2012 15:59:41 -0500
Subject: MAINT-1721 Fix for crash when clicking "back" button after editing
 appearance.

Reviewed by VoidPointer
---
 indra/llimage/llimage.cpp    | 6 ++++++
 indra/llimage/llimage.h      | 2 +-
 indra/newview/lltexlayer.cpp | 8 +++++++-
 3 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/indra/llimage/llimage.cpp b/indra/llimage/llimage.cpp
index 6775b005f4..825878c5ef 100644
--- a/indra/llimage/llimage.cpp
+++ b/indra/llimage/llimage.cpp
@@ -1660,6 +1660,12 @@ static void avg4_colors2(const U8* a, const U8* b, const U8* c, const U8* d, U8*
 	dst[1] = (U8)(((U32)(a[1]) + b[1] + c[1] + d[1])>>2);
 }
 
+void LLImageBase::setDataAndSize(U8 *data, S32 size)
+{ 
+	ll_assert_aligned(data, 16);
+	mData = data; mDataSize = size; 
+}	
+
 //static
 void LLImageBase::generateMip(const U8* indata, U8* mipdata, S32 width, S32 height, S32 nchannels)
 {
diff --git a/indra/llimage/llimage.h b/indra/llimage/llimage.h
index 46e6d1a901..9ce77a0d01 100644
--- a/indra/llimage/llimage.h
+++ b/indra/llimage/llimage.h
@@ -148,7 +148,7 @@ public:
 
 protected:
 	// special accessor to allow direct setting of mData and mDataSize by LLImageFormatted
-	void setDataAndSize(U8 *data, S32 size) { mData = data; mDataSize = size; }	
+	void setDataAndSize(U8 *data, S32 size);
 	
 public:
 	static void generateMip(const U8 *indata, U8* mipdata, int width, int height, S32 nchannels);
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'
-- 
cgit v1.2.3


From ab9debd9944e690421a098ec49a7974ad88b40e3 Mon Sep 17 00:00:00 2001
From: Oz Linden <oz@lindenlab.com>
Date: Mon, 15 Oct 2012 23:18:55 -0400
Subject: tag merge of DRTVWR-228

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index dcf7a4fc99..1f1b26194b 100644
--- a/.hgtags
+++ b/.hgtags
@@ -321,3 +321,4 @@ fba99f381b8d4ad1b7b42fa4993b29998d95be18 DRTVWR-179
 49ed253c80bed7410e238eeab35a9f14cb034364 3.4.1-beta6
 468ca3268229011a59df99229b24315844b33d34 DRTVWR-227
 524da902713e8b60322640b9825101add4a7c497 3.4.1-beta7
+173c2809f9873499c4b9d6bc044ec941c954d3fb DRTVWR-228
-- 
cgit v1.2.3


From a7f6dcaef7fb49901a2ebf0629e3089fa8cdad98 Mon Sep 17 00:00:00 2001
From: Oz Linden <oz@lindenlab.com>
Date: Mon, 15 Oct 2012 23:19:06 -0400
Subject: Added tag 3.4.1-beta8 for changeset 1dc94555582f

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index 1f1b26194b..b9c59588e1 100644
--- a/.hgtags
+++ b/.hgtags
@@ -322,3 +322,4 @@ fba99f381b8d4ad1b7b42fa4993b29998d95be18 DRTVWR-179
 468ca3268229011a59df99229b24315844b33d34 DRTVWR-227
 524da902713e8b60322640b9825101add4a7c497 3.4.1-beta7
 173c2809f9873499c4b9d6bc044ec941c954d3fb DRTVWR-228
+1dc94555582f52718834081e7659e973ae4521f7 3.4.1-beta8
-- 
cgit v1.2.3