diff --git a/indra/llimage/llimage.cpp b/indra/llimage/llimage.cpp
index f71607096c8e7c51d6f6a6622c8b72c42644edec..a6cbcc131ec657d586e52c02dd584f64c0441eb3 100644
--- a/indra/llimage/llimage.cpp
+++ b/indra/llimage/llimage.cpp
@@ -1218,9 +1218,10 @@ void LLImageRaw::fill( const LLColor4U& color )
 	if( 4 == getComponents() )
 	{
 		U32* data = (U32*) getData();
+		U32 rgbaColor = color.asRGBA();
 		for( S32 i = 0; i < pixels; i++ )
 		{
-			data[i] = color.mAll;
+			data[ i ] = rgbaColor;
 		}
 	}
 	else
diff --git a/indra/llmath/v4coloru.h b/indra/llmath/v4coloru.h
index fddad349789139a076f86a1e72285245359151d0..31ae3e3c1a3b551ee3060cfdd90247a7a55f1f3e 100644
--- a/indra/llmath/v4coloru.h
+++ b/indra/llmath/v4coloru.h
@@ -47,14 +47,7 @@ class LLColor4U
 {
 public:
 
-	union
-	{
-		U8         mV[LENGTHOFCOLOR4U];
-		U32        mAll;
-		LLColor4*  mSources;
-		LLColor4U* mSourcesU;
-	};
-
+	U8 mV[LENGTHOFCOLOR4U];
 
 	LLColor4U();						// Initializes LLColor4U to (0, 0, 0, 1)
 	LLColor4U(U8 r, U8 g, U8 b);		// Initializes LLColor4U to (r, g, b, 1)
@@ -132,6 +125,9 @@ class LLColor4U
 		return LLColor4(*this);
 	}
 
+	U32 asRGBA() const;
+	void fromRGBA( U32 aVal );
+
 	static LLColor4U white;
 	static LLColor4U black;
 	static LLColor4U red;
@@ -565,6 +561,36 @@ void LLColor4U::setVecScaleClamp(const LLColor3& color)
 	mV[3] = 255;
 }
 
+inline U32 LLColor4U::asRGBA() const
+{
+	U32 nRet( 0 );
+
+	// Little endian: values are swapped in memory. The original code access the array like a U32, so we need to swap here
+
+	nRet |= mV[ 3 ];
+	nRet <<= 8;
+	nRet |= mV[ 2 ];
+	nRet <<= 8;
+	nRet |= mV[ 1 ];
+	nRet <<= 8;
+	nRet |= mV[ 0 ];
+
+	return nRet;
+}
+
+inline void LLColor4U::fromRGBA( U32 aVal )
+{
+	// Little endian: values are swapped in memory. The original code access the array like a U32, so we need to swap here
+
+	mV[ 0 ] = aVal & 0xFF;
+	aVal >>= 8;
+	mV[ 1 ] = aVal & 0xFF;
+	aVal >>= 8;
+	mV[ 2 ] = aVal & 0xFF;
+	aVal >>= 8;
+	mV[ 3 ] = aVal & 0xFF;
+}
+
 
 #endif
 
diff --git a/indra/newview/llface.cpp b/indra/newview/llface.cpp
index de349a03d4cafe9878c5e53bbae42b2335995c00..481c66aaf55d7dff279d29e72796a647b2d35be3 100644
--- a/indra/newview/llface.cpp
+++ b/indra/newview/llface.cpp
@@ -2132,7 +2132,7 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume,
 			LLVector4a src;
 
 			U32 vec[4];
-			vec[0] = vec[1] = vec[2] = vec[3] = color.mAll;
+			vec[0] = vec[1] = vec[2] = vec[3] = color.asRGBA();
 		
 			src.loadua((F32*) vec);
 
@@ -2168,7 +2168,7 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume,
 		
 			LLColor4U glow4u = LLColor4U(0,0,0,glow);
 
-			U32 glow32 = glow4u.mAll;
+			U32 glow32 = glow4u.asRGBA();
 
 			U32 vec[4];
 			vec[0] = vec[1] = vec[2] = vec[3] = glow32;
diff --git a/indra/newview/llnetmap.cpp b/indra/newview/llnetmap.cpp
index 5fc73c67d1bfbbf4c17c1f0464bdfbe096274a51..72faa5a9e747342ce2381b8e39961c7b31fee66b 100644
--- a/indra/newview/llnetmap.cpp
+++ b/indra/newview/llnetmap.cpp
@@ -735,7 +735,7 @@ void LLNetMap::renderPoint(const LLVector3 &pos_local, const LLColor4U &color,
 				continue;
 			}
 			S32 offset = px + py * image_width;
-			((U32*)datap)[offset] = color.mAll;
+			((U32*)datap)[offset] = color.asRGBA();
 		}
 
 		// top line
@@ -748,7 +748,7 @@ void LLNetMap::renderPoint(const LLVector3 &pos_local, const LLColor4U &color,
 				continue;
 			}
 			S32 offset = px + py * image_width;
-			((U32*)datap)[offset] = color.mAll;
+			((U32*)datap)[offset] = color.asRGBA();
 		}
 	}
 	else
@@ -770,7 +770,7 @@ void LLNetMap::renderPoint(const LLVector3 &pos_local, const LLColor4U &color,
 					continue;
 				}
 				S32 offset = p_x + p_y * image_width;
-				((U32*)datap)[offset] = color.mAll;
+				((U32*)datap)[offset] = color.asRGBA();
 			}
 		}
 	}
diff --git a/indra/newview/llvosky.cpp b/indra/newview/llvosky.cpp
index 4dab213fa0e8d16837edc650343a2e000d953ba6..6b4a450e6fe202537a3f4c79495ae488700de155 100644
--- a/indra/newview/llvosky.cpp
+++ b/indra/newview/llvosky.cpp
@@ -283,7 +283,7 @@ void LLSkyTex::create(const F32 brightness)
 			S32 offset = basic_offset * sComponents;
 			U32* pix = (U32*)(data + offset);
 			LLColor4U temp = LLColor4U(mSkyData[basic_offset]);
-			*pix = temp.mAll;
+			*pix = temp.asRGBA();
 		}
 	}
 	createGLImage(sCurrent);
diff --git a/indra/newview/llvosky.h b/indra/newview/llvosky.h
index ee8e91fb71d3a869f6e844777665345e5c8d5678..9cfb9773bd8ccb16486e77d3aac7497b851db688 100644
--- a/indra/newview/llvosky.h
+++ b/indra/newview/llvosky.h
@@ -171,7 +171,7 @@ class LLSkyTex
 	{
 		S32 offset = (i * sResolution + j) * sComponents;
 		U32* pix = (U32*) &(mImageRaw[sCurrent]->getData()[offset]);
-		*pix = col.mAll;
+		*pix = col.asRGBA();
 	}
 
 	LLColor4U getPixel(const S32 i, const S32 j)
@@ -179,7 +179,7 @@ class LLSkyTex
 		LLColor4U col;
 		S32 offset = (i * sResolution + j) * sComponents;
 		U32* pix = (U32*) &(mImageRaw[sCurrent]->getData()[offset]);
-		col.mAll = *pix;
+		col.fromRGBA( *pix );
 		return col;
 	}