diff --git a/indra/llappearance/lltexlayer.cpp b/indra/llappearance/lltexlayer.cpp
index 63d01999f0610c3cc843bc47917d91852e7bb79b..4cf82a3740d4c767dfbfe8883e28446aa6908416 100644
--- a/indra/llappearance/lltexlayer.cpp
+++ b/indra/llappearance/lltexlayer.cpp
@@ -1973,7 +1973,10 @@ LLGLTexture* LLTexLayerStaticImageList::getTexture(const std::string& file_name,
 	}
 	else
 	{
-		llassert(gTextureManagerBridgep);
+		if (!gTextureManagerBridgep)
+		{
+			return LLPointer<LLGLTexture>();
+		}
 		tex = gTextureManagerBridgep->getLocalTexture( FALSE );
 		LLPointer<LLImageRaw> image_raw = new LLImageRaw;
 		if( loadImageRaw( file_name, image_raw ) )
diff --git a/indra/llappearance/llwearable.cpp b/indra/llappearance/llwearable.cpp
index d86a460511fba4cb052b8d40029dae735488e08b..61cd995cea1f0307ee8c0c4bd5eb1666130f9f1f 100644
--- a/indra/llappearance/llwearable.cpp
+++ b/indra/llappearance/llwearable.cpp
@@ -420,6 +420,12 @@ LLWearable::EImportResult LLWearable::importStream( std::istream& input_stream,
 				return LLWearable::FAILURE;
 		}
 		LLUUID id = LLUUID(uuid_buffer);
+
+		if (!gTextureManagerBridgep)
+		{
+			continue;
+		}
+
 		LLGLTexture* image = gTextureManagerBridgep->getFetchedTexture( id );
 		if( mTEMap.find(te) != mTEMap.end() )
 		{
@@ -592,7 +598,10 @@ void LLWearable::syncImages(te_map_t &src, te_map_t &dst)
 			{
 				// there is no Local Texture Object in the source image map. Get defaults values for populating the destination image map.
 				image_id = getDefaultTextureImageID((ETextureIndex) te);
-				image = gTextureManagerBridgep->getFetchedTexture( image_id );
+				if (gTextureManagerBridgep)
+				{
+					image = gTextureManagerBridgep->getFetchedTexture( image_id );
+				}
 			}
 
 			if( dst.find(te) != dst.end() )
diff --git a/indra/llimage/llimage.cpp b/indra/llimage/llimage.cpp
index c8a05e1faea6e0244ecc03f88c325bc7f5570879..55609deb2b4af4b0228effd0547f0a5eb5c5430d 100755
--- a/indra/llimage/llimage.cpp
+++ b/indra/llimage/llimage.cpp
@@ -230,7 +230,7 @@ const U8* LLImageBase::getData() const
 { 
 	if(mBadBufferAllocation)
 	{
-		llerrs << "Bad memory allocation for the image buffer!" << llendl ;
+		llwarns << "Bad memory allocation for the image buffer!" << llendl ;
 	}
 
 	return mData; 
@@ -240,7 +240,7 @@ U8* LLImageBase::getData()
 { 
 	if(mBadBufferAllocation)
 	{
-		llerrs << "Bad memory allocation for the image buffer!" << llendl ;
+		llwarns << "Bad memory allocation for the image buffer!" << llendl ;
 	}
 
 	return mData; 
@@ -293,7 +293,7 @@ LLImageRaw::LLImageRaw(U8 *data, U16 width, U16 height, S8 components, bool no_c
 	{
 		setDataAndSize(data, width, height, components);
 	}
-	else if(allocateDataSize(width, height, components))
+	else if(allocateDataSize(width, height, components) && getData())
 	{
 		memcpy(getData(), data, width*height*components);
 	}
@@ -431,6 +431,11 @@ void LLImageRaw::clear(U8 r, U8 g, U8 b, U8 a)
 // Reverses the order of the rows in the image
 void LLImageRaw::verticalFlip()
 {
+	if (!getData())
+	{
+		return;
+	}
+
 	S32 row_bytes = getWidth() * getComponents();
 	llassert(row_bytes > 0);
 	std::vector<U8> line_buffer(row_bytes);
@@ -666,6 +671,11 @@ void LLImageRaw::copyUnscaledAlphaMask( LLImageRaw* src, const LLColor4U& fill)
 // Fill the buffer with a constant color
 void LLImageRaw::fill( const LLColor4U& color )
 {
+	if (!getData())
+	{
+		return;
+	}
+
 	S32 pixels = getWidth() * getHeight();
 	if( 4 == getComponents() )
 	{
@@ -867,6 +877,11 @@ void LLImageRaw::copyScaled( LLImageRaw* src )
 
 BOOL LLImageRaw::scale( S32 new_width, S32 new_height, BOOL scale_image_data )
 {
+	if (!getData())
+	{
+		return FALSE;
+	}
+
 	llassert((1 == getComponents()) || (3 == getComponents()) || (4 == getComponents()) );
 
 	S32 old_width = getWidth();
@@ -901,7 +916,7 @@ BOOL LLImageRaw::scale( S32 new_width, S32 new_height, BOOL scale_image_data )
 			copyLineScaled( &temp_buffer[0] + (getComponents() * old_width * row), new_buffer + (getComponents() * new_width * row), old_width, new_width, 1, 1 );
 		}
 	}
-	else
+	else if (getData())
 	{
 		// copy	out	existing image data
 		S32	temp_data_size = old_width * old_height	* getComponents();
@@ -1478,7 +1493,7 @@ void LLImageFormatted::sanityCheck()
 
 BOOL LLImageFormatted::copyData(U8 *data, S32 size)
 {
-	if ( data && ((data != getData()) || (size != getDataSize())) )
+	if ( data && getData() && ((data != getData()) || (size != getDataSize())) )
 	{
 		deleteData();
 		allocateData(size);
@@ -1564,6 +1579,11 @@ BOOL LLImageFormatted::load(const std::string &filename, int load_size)
 
 BOOL LLImageFormatted::save(const std::string &filename)
 {
+	if (!getData())
+	{
+		return FALSE;
+	}
+
 	resetLastError();
 
 	LLAPRFile outfile ;
diff --git a/indra/llimage/llimagepng.cpp b/indra/llimage/llimagepng.cpp
index 294f68b1220cf0ad761a8f4daad227147007c9e0..525aa8d78c3658e5fc33d2d90ac52e120685aa56 100755
--- a/indra/llimage/llimagepng.cpp
+++ b/indra/llimage/llimagepng.cpp
@@ -94,6 +94,13 @@ BOOL LLImagePNG::decode(LLImageRaw* raw_image, F32 decode_time)
         return FALSE;
     }
 
+	// Check to make sure that this instance has been initialized with data
+	if (!raw_image->getData())
+	{
+		setLastError("LLImagePNG trying to decode an image into unallocated LLImageRaw!");
+		return FALSE;
+	}
+
 	// Decode the PNG data into the raw image
 	LLPngWrapper pngWrapper;
 	if (!pngWrapper.isValidPng(getData()))
diff --git a/indra/llimage/llimageworker.cpp b/indra/llimage/llimageworker.cpp
index ad2eb0f69c56e1f9968940707f2b11567765d10f..148cf4fa55f9f809774a8c749af488b83c038a1b 100755
--- a/indra/llimage/llimageworker.cpp
+++ b/indra/llimage/llimageworker.cpp
@@ -142,8 +142,12 @@ bool LLImageDecodeThread::ImageRequest::processRequest()
 											  mFormattedImage->getHeight(),
 											  mFormattedImage->getComponents());
 		}
-		done = mFormattedImage->decode(mDecodedImageRaw, decode_time_slice); // 1ms
-		mDecodedRaw = done;
+
+		if (mDecodedImageRaw->getData())
+		{
+			done = mFormattedImage->decode(mDecodedImageRaw, decode_time_slice); // 1ms
+			mDecodedRaw = done;
+		}
 	}
 	if (done && mNeedsAux && !mDecodedAux && mFormattedImage.notNull())
 	{
@@ -154,8 +158,12 @@ bool LLImageDecodeThread::ImageRequest::processRequest()
 											  mFormattedImage->getHeight(),
 											  1);
 		}
-		done = mFormattedImage->decodeChannels(mDecodedImageAux, decode_time_slice, 4, 4); // 1ms
-		mDecodedAux = done;
+
+		if (mDecodedImageAux->getData())
+		{
+			done = mFormattedImage->decodeChannels(mDecodedImageAux, decode_time_slice, 4, 4); // 1ms
+			mDecodedAux = done;
+		}
 	}
 
 	return done;
diff --git a/indra/llrender/llcubemap.cpp b/indra/llrender/llcubemap.cpp
index 45a3b18179a8aff6b2646aaf02e5aea96bf05add..0dad4285d93a6bcf223722e20642547b95f6f249 100755
--- a/indra/llrender/llcubemap.cpp
+++ b/indra/llrender/llcubemap.cpp
@@ -116,6 +116,11 @@ void LLCubeMap::initRawData(const std::vector<LLPointer<LLImageRaw> >& rawimages
 		const U8 *sd = rawimages[i]->getData();
 		U8 *td = mRawImages[i]->getData();
 
+		if (!sd || !td)
+		{
+			continue;
+		}
+
 		S32 offset = 0;
 		S32 sx, sy, so;
 		for (int y = 0; y < 64; y++)
diff --git a/indra/llrender/llfontfreetype.cpp b/indra/llrender/llfontfreetype.cpp
index 84c782e958137a2f6d35f84d0de4fee3dd6939a1..7ab4e93da5daf000a2d02f8698a935ce0f89d2be 100755
--- a/indra/llrender/llfontfreetype.cpp
+++ b/indra/llrender/llfontfreetype.cpp
@@ -448,7 +448,11 @@ LLFontGlyphInfo* LLFontFreetype::addGlyphFromFont(const LLFontFreetype *fontp, l
 	
 	LLImageGL *image_gl = mFontBitmapCachep->getImageGL(bitmap_num);
 	LLImageRaw *image_raw = mFontBitmapCachep->getImageRaw(bitmap_num);
-	image_gl->setSubImage(image_raw, 0, 0, image_gl->getWidth(), image_gl->getHeight());
+	
+	if (image_gl)
+	{
+		image_gl->setSubImage(image_raw, 0, 0, image_gl->getWidth(), image_gl->getHeight());
+	}
 
 	return gi;
 }
@@ -560,13 +564,18 @@ void LLFontFreetype::setSubImageLuminanceAlpha(U32 x, U32 y, U32 bitmap_num, U32
 {
 	LLImageRaw *image_raw = mFontBitmapCachep->getImageRaw(bitmap_num);
 
+	if (!image_raw)
+	{
+		return;
+	}
+
 	llassert(!mIsFallback);
-	llassert(image_raw && (image_raw->getComponents() == 2));
+	llassert(image_raw->getComponents() == 2);
 
 	
 	U8 *target = image_raw->getData();
 
-	if (!data)
+	if (!data || !target)
 	{
 		return;
 	}
diff --git a/indra/llrender/llimagegl.cpp b/indra/llrender/llimagegl.cpp
index ab875141c57dc2469744344242ab797daecc2405..315cc57e517d7211eb5de695dee55dde4687f7a2 100755
--- a/indra/llrender/llimagegl.cpp
+++ b/indra/llrender/llimagegl.cpp
@@ -1251,6 +1251,11 @@ BOOL LLImageGL::createGLTexture(S32 discard_level, const LLImageRaw* imageraw, S
 		return FALSE;
 	}
 
+	if (!imageraw->getData())
+	{
+		return FALSE;
+	}
+
 	mGLTextureCreated = false ;
 	llassert(gGLManager.mInited);
 	stop_glerror();
diff --git a/indra/newview/lldrawpoolbump.cpp b/indra/newview/lldrawpoolbump.cpp
index 6b4c5cfca1abce22d1c4e56a41ab1677b8ec11c4..49ac82e786d1e878f5a25876d850694306b45965 100755
--- a/indra/newview/lldrawpoolbump.cpp
+++ b/indra/newview/lldrawpoolbump.cpp
@@ -1232,6 +1232,7 @@ void LLBumpImageList::onSourceLoaded( BOOL success, LLViewerTexture *src_vi, LLI
 
 		//if (iter->second->getWidth() != src->getWidth() ||
 		//	iter->second->getHeight() != src->getHeight()) // bump not cached yet or has changed resolution
+		if (src->getData())
 		{
 			LLPointer<LLImageRaw> dst_image = new LLImageRaw(src->getWidth(), src->getHeight(), 1);
 			U8* dst_data = dst_image->getData();
diff --git a/indra/newview/lldrawpoolterrain.cpp b/indra/newview/lldrawpoolterrain.cpp
index c3ec23422310786c2176ab2d970709cfd2b49f3f..d7ecacf2e677c1446af8e4b250e85b994e3224b3 100755
--- a/indra/newview/lldrawpoolterrain.cpp
+++ b/indra/newview/lldrawpoolterrain.cpp
@@ -88,8 +88,11 @@ LLDrawPoolTerrain::LLDrawPoolTerrain(LLViewerTexture *texturep) :
 	//gGL.getTexUnit(0)->bind(m2DAlphaRampImagep.get());
 	m2DAlphaRampImagep->setAddressMode(LLTexUnit::TAM_CLAMP);
 	
-	mTexturep->setBoostLevel(LLGLTexture::BOOST_TERRAIN);
-	
+	if (mTexturep)
+	{
+		mTexturep->setBoostLevel(LLGLTexture::BOOST_TERRAIN);
+	}
+
 	//gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
 }
 
@@ -851,11 +854,18 @@ void LLDrawPoolTerrain::renderSimple()
 	// Pass 1/1
 
 	// Stage 0: Base terrain texture pass
-	mTexturep->addTextureStats(1024.f*1024.f);
+	if (mTexturep)
+	{
+		mTexturep->addTextureStats(1024.f*1024.f);
+	}
 
 	gGL.getTexUnit(0)->activate();
 	gGL.getTexUnit(0)->enable(LLTexUnit::TT_TEXTURE);
-	gGL.getTexUnit(0)->bind(mTexturep);
+
+	if (mTexturep)
+	{
+		gGL.getTexUnit(0)->bind(mTexturep);
+	}
 	
 	LLVector3 origin_agent = mDrawFace[0]->getDrawable()->getVObj()->getRegion()->getOriginAgent();
 	F32 tscale = 1.f/256.f;
diff --git a/indra/newview/llnetmap.cpp b/indra/newview/llnetmap.cpp
index 08b5eaedbbe9d5d899324b90a8ab3fc00de98081..193e2ea678a5ba71d1eedebf078f8e6b2fe7e09f 100755
--- a/indra/newview/llnetmap.cpp
+++ b/indra/newview/llnetmap.cpp
@@ -798,7 +798,10 @@ void LLNetMap::createObjectImage()
 	{
 		mObjectRawImagep = new LLImageRaw(img_size, img_size, 4);
 		U8* data = mObjectRawImagep->getData();
-		memset( data, 0, img_size * img_size * 4 );
+		if (data)
+		{
+			memset( data, 0, img_size * img_size * 4 );
+		}
 		mObjectImagep = LLViewerTextureManager::getLocalTexture( mObjectRawImagep.get(), FALSE);
 	}
 	setScale(mScale);
diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp
index c86e8df4b6f7a3b324d3e05da5fafd84a1dcf1b7..6361c18c9fc9bd44f70506868b281b41ca92032c 100755
--- a/indra/newview/llstartup.cpp
+++ b/indra/newview/llstartup.cpp
@@ -2684,7 +2684,7 @@ void init_start_screen(S32 location_id)
 		}
 	}
 
-	if(gStartTexture.isNull())
+	if(gStartTexture && gStartTexture.isNull())
 	{
 		gStartTexture = LLViewerTexture::sBlackImagep ;
 		gStartImageWidth = gStartTexture->getWidth() ;
diff --git a/indra/newview/llsurface.cpp b/indra/newview/llsurface.cpp
index 93c7f54101372724aea6ef9e381aecca56354d08..f1b27279e3a097b3df2bfda85a9fe8e5a93b1173 100755
--- a/indra/newview/llsurface.cpp
+++ b/indra/newview/llsurface.cpp
@@ -233,6 +233,12 @@ void LLSurface::createSTexture()
 		// GL NOT ACTIVE HERE
 		LLPointer<LLImageRaw> raw = new LLImageRaw(sTextureSize, sTextureSize, 3);
 		U8 *default_texture = raw->getData();
+
+		if (!default_texture)
+		{
+			return;
+		}
+
 		for (S32 i = 0; i < sTextureSize; i++)
 		{
 			for (S32 j = 0; j < sTextureSize; j++)
@@ -257,6 +263,12 @@ void LLSurface::createWaterTexture()
 		// Create the water texture
 		LLPointer<LLImageRaw> raw = new LLImageRaw(sTextureSize/2, sTextureSize/2, 4);
 		U8 *default_texture = raw->getData();
+
+		if (!default_texture)
+		{
+			return;
+		}
+
 		for (S32 i = 0; i < sTextureSize/2; i++)
 		{
 			for (S32 j = 0; j < sTextureSize/2; j++)
diff --git a/indra/newview/lltexturecache.cpp b/indra/newview/lltexturecache.cpp
index 5bc2e971ebee8be581ba3049511b3334db38a330..8d9d2421da7a732a287ea0a59c5bfe308f64d509 100755
--- a/indra/newview/lltexturecache.cpp
+++ b/indra/newview/lltexturecache.cpp
@@ -1937,7 +1937,7 @@ bool LLTextureCache::writeToFastCache(S32 id, LLPointer<LLImageRaw> raw, S32 dis
 	memcpy(mFastCachePadBuffer + sizeof(S32) * 3, &discardlevel, sizeof(S32));
 
 	S32 copy_size = w * h * c;
-	if(copy_size > 0) //valid
+	if(copy_size > 0 && raw->getData()) //valid
 	{
 		copy_size = llmin(copy_size, TEXTURE_FAST_CACHE_ENTRY_SIZE - TEXTURE_FAST_CACHE_ENTRY_OVERHEAD);
 		memcpy(mFastCachePadBuffer + TEXTURE_FAST_CACHE_ENTRY_OVERHEAD, raw->getData(), copy_size);
diff --git a/indra/newview/llviewerparceloverlay.cpp b/indra/newview/llviewerparceloverlay.cpp
index a1c12c5cd6ead81bfc950b2fc4ff811ffd13933d..fad77bce255ed05b2f6a6ea05afc905338996e68 100755
--- a/indra/newview/llviewerparceloverlay.cpp
+++ b/indra/newview/llviewerparceloverlay.cpp
@@ -76,10 +76,13 @@ LLViewerParcelOverlay::LLViewerParcelOverlay(LLViewerRegion* region, F32 region_
 	//
 	// Create the base texture.
 	U8 *raw = mImageRaw->getData();
-	const S32 COUNT = mParcelGridsPerEdge * mParcelGridsPerEdge * OVERLAY_IMG_COMPONENTS;
-	for (S32 i = 0; i < COUNT; i++)
+	if (raw)
 	{
-		raw[i] = 0;
+		const S32 COUNT = mParcelGridsPerEdge * mParcelGridsPerEdge * OVERLAY_IMG_COMPONENTS;
+		for (S32 i = 0; i < COUNT; i++)
+		{
+			raw[i] = 0;
+		}
 	}
 	//mTexture->setSubImage(mImageRaw, 0, 0, mParcelGridsPerEdge, mParcelGridsPerEdge);
 
@@ -380,10 +383,13 @@ void LLViewerParcelOverlay::updateOverlayTexture()
 			break;
 		}
 
-		raw[pixel_index + 0] = (U8)r;
-		raw[pixel_index + 1] = (U8)g;
-		raw[pixel_index + 2] = (U8)b;
-		raw[pixel_index + 3] = (U8)a;
+		if (raw)
+		{
+			raw[pixel_index + 0] = (U8)r;
+			raw[pixel_index + 1] = (U8)g;
+			raw[pixel_index + 2] = (U8)b;
+			raw[pixel_index + 3] = (U8)a;
+		}
 
 		pixel_index += OVERLAY_IMG_COMPONENTS;
 	}
diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp
index 3da6d33d7281990b74a99608523aac72dc9d8704..6364eee3ec8a32c54f6b42a1e559dbcacf1c9220 100755
--- a/indra/newview/llviewertexture.cpp
+++ b/indra/newview/llviewertexture.cpp
@@ -337,6 +337,11 @@ void LLViewerTextureManager::init()
 	const S32 dim = 128;
 	LLPointer<LLImageRaw> image_raw = new LLImageRaw(dim,dim,3);
 	U8* data = image_raw->getData();
+
+	if (!data)
+	{
+		return;
+	}
 	
 	memset(data, 0, dim * dim * 3) ;
 	LLViewerTexture::sBlackImagep = LLViewerTextureManager::getLocalTexture(image_raw.get(), TRUE) ;
@@ -373,8 +378,12 @@ void LLViewerTextureManager::init()
 #else
  	LLViewerFetchedTexture::sDefaultImagep = LLViewerTextureManager::getFetchedTexture(IMG_DEFAULT, TRUE, LLGLTexture::BOOST_UI);
 #endif
-	LLViewerFetchedTexture::sDefaultImagep->dontDiscard();
-	LLViewerFetchedTexture::sDefaultImagep->setCategory(LLGLTexture::OTHER) ;
+
+	if (LLViewerFetchedTexture::sDefaultImagep)
+	{
+		LLViewerFetchedTexture::sDefaultImagep->dontDiscard();
+		LLViewerFetchedTexture::sDefaultImagep->setCategory(LLGLTexture::OTHER) ;
+	}
 
  	LLViewerFetchedTexture::sSmokeImagep = LLViewerTextureManager::getFetchedTexture(IMG_SMOKE, FTT_DEFAULT, TRUE, LLGLTexture::BOOST_UI);
 	LLViewerFetchedTexture::sSmokeImagep->setNoDelete() ;
@@ -690,7 +699,7 @@ bool LLViewerTexture::bindDefaultImage(S32 stage)
 	if (stage < 0) return false;
 
 	bool res = true;
-	if (LLViewerFetchedTexture::sDefaultImagep.notNull() && (this != LLViewerFetchedTexture::sDefaultImagep.get()))
+	if (LLViewerFetchedTexture::sDefaultImagep && LLViewerFetchedTexture::sDefaultImagep.notNull() && (this != LLViewerFetchedTexture::sDefaultImagep.get()))
 	{
 		// use default if we've got it
 		res = gGL.getTexUnit(stage)->bind(LLViewerFetchedTexture::sDefaultImagep);
diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp
index 082a85e2171ce436477e2dbe6560492f612bd768..ca004962d57f60a61f0a74d62645a54249705c5d 100755
--- a/indra/newview/llvoavatarself.cpp
+++ b/indra/newview/llvoavatarself.cpp
@@ -818,7 +818,8 @@ void LLVOAvatarSelf::setLocalTextureTE(U8 te, LLViewerTexture* image, U32 index)
 		return;
 	}
 
-	if (getTEImage(te)->getID() == image->getID())
+	LLViewerTexture * tx = getTEImage(te);
+	if (!tx || tx->getID() == image->getID())
 	{
 		return;
 	}
@@ -1698,6 +1699,7 @@ S32 LLVOAvatarSelf::getLocalDiscardLevel(ETextureIndex type, U32 wearable_index)
 		const LLViewerFetchedTexture* image = dynamic_cast<LLViewerFetchedTexture*>( local_tex_obj->getImage() );
 		if (type >= 0
 			&& local_tex_obj->getID() != IMG_DEFAULT_AVATAR
+			&& image
 			&& !image->isMissingAsset())
 		{
 			return image->getDiscardLevel();
@@ -2036,7 +2038,10 @@ BOOL LLVOAvatarSelf::getIsCloud() const
 /*static*/
 void LLVOAvatarSelf::debugOnTimingLocalTexLoaded(BOOL success, LLViewerFetchedTexture *src_vi, LLImageRaw* src, LLImageRaw* aux_src, S32 discard_level, BOOL final, void* userdata)
 {
-	gAgentAvatarp->debugTimingLocalTexLoaded(success, src_vi, src, aux_src, discard_level, final, userdata);
+	if (gAgentAvatarp)
+	{
+		gAgentAvatarp->debugTimingLocalTexLoaded(success, src_vi, src, aux_src, discard_level, final, userdata);
+	}
 }
 
 void LLVOAvatarSelf::debugTimingLocalTexLoaded(BOOL success, LLViewerFetchedTexture *src_vi, LLImageRaw* src, LLImageRaw* aux_src, S32 discard_level, BOOL final, void* userdata)
diff --git a/indra/newview/llvosky.cpp b/indra/newview/llvosky.cpp
index 93f0e50336e90e0da161eb85f4a3411502cfd567..467152881e3059d7e3a87a26364a44d6f1016ab3 100755
--- a/indra/newview/llvosky.cpp
+++ b/indra/newview/llvosky.cpp
@@ -257,18 +257,21 @@ LLSkyTex::~LLSkyTex()
 void LLSkyTex::initEmpty(const S32 tex)
 {
 	U8* data = mImageRaw[tex]->getData();
-	for (S32 i = 0; i < sResolution; ++i)
+	if (data)
 	{
-		for (S32 j = 0; j < sResolution; ++j)
+		for (S32 i = 0; i < sResolution; ++i)
 		{
-			const S32 basic_offset = (i * sResolution + j);
-			S32 offset = basic_offset * sComponents;
-			data[offset] = 0;
-			data[offset+1] = 0;
-			data[offset+2] = 0;
-			data[offset+3] = 255;
-
-			mSkyData[basic_offset].setToBlack();
+			for (S32 j = 0; j < sResolution; ++j)
+			{
+				const S32 basic_offset = (i * sResolution + j);
+				S32 offset = basic_offset * sComponents;
+				data[offset] = 0;
+				data[offset+1] = 0;
+				data[offset+2] = 0;
+				data[offset+3] = 255;
+
+				mSkyData[basic_offset].setToBlack();
+			}
 		}
 	}
 
@@ -279,17 +282,21 @@ void LLSkyTex::create(const F32 brightness)
 {
 	/// Brightness ignored for now.
 	U8* data = mImageRaw[sCurrent]->getData();
-	for (S32 i = 0; i < sResolution; ++i)
+	if (data)
 	{
-		for (S32 j = 0; j < sResolution; ++j)
+		for (S32 i = 0; i < sResolution; ++i)
 		{
-			const S32 basic_offset = (i * sResolution + j);
-			S32 offset = basic_offset * sComponents;
-			U32* pix = (U32*)(data + offset);
-			LLColor4U temp = LLColor4U(mSkyData[basic_offset]);
-			*pix = temp.mAll;
+			for (S32 j = 0; j < sResolution; ++j)
+			{
+				const S32 basic_offset = (i * sResolution + j);
+				S32 offset = basic_offset * sComponents;
+				U32* pix = (U32*)(data + offset);
+				LLColor4U temp = LLColor4U(mSkyData[basic_offset]);
+				*pix = temp.mAll;
+			}
 		}
 	}
+
 	createGLImage(sCurrent);
 }
 
diff --git a/indra/newview/llworld.cpp b/indra/newview/llworld.cpp
index 85614f397c02a3ee269bed82713f6b59378896df..27256af97aaf142815c0ca03065a9a050679949e 100755
--- a/indra/newview/llworld.cpp
+++ b/indra/newview/llworld.cpp
@@ -101,15 +101,21 @@ LLWorld::LLWorld() :
 
 	LLPointer<LLImageRaw> raw = new LLImageRaw(1,1,4);
 	U8 *default_texture = raw->getData();
-	*(default_texture++) = MAX_WATER_COLOR.mV[0];
-	*(default_texture++) = MAX_WATER_COLOR.mV[1];
-	*(default_texture++) = MAX_WATER_COLOR.mV[2];
-	*(default_texture++) = MAX_WATER_COLOR.mV[3];
-	
-	mDefaultWaterTexturep = LLViewerTextureManager::getLocalTexture(raw.get(), FALSE);
-	gGL.getTexUnit(0)->bind(mDefaultWaterTexturep);
-	mDefaultWaterTexturep->setAddressMode(LLTexUnit::TAM_CLAMP);
 
+	if (default_texture)
+	{
+		*(default_texture++) = MAX_WATER_COLOR.mV[0];
+		*(default_texture++) = MAX_WATER_COLOR.mV[1];
+		*(default_texture++) = MAX_WATER_COLOR.mV[2];
+		*(default_texture++) = MAX_WATER_COLOR.mV[3];
+	}
+
+	if (mDefaultWaterTexturep)
+	{
+		mDefaultWaterTexturep = LLViewerTextureManager::getLocalTexture(raw.get(), FALSE);
+		gGL.getTexUnit(0)->bind(mDefaultWaterTexturep);
+		mDefaultWaterTexturep->setAddressMode(LLTexUnit::TAM_CLAMP);
+	}
 }
 
 
diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp
index 5da8a78b1b423ed43a30dc6e4007364297a4d64e..0af1143ae8336dd371d6c0145100edeebea52d22 100755
--- a/indra/newview/pipeline.cpp
+++ b/indra/newview/pipeline.cpp
@@ -4410,9 +4410,11 @@ void LLPipeline::renderGeom(LLCamera& camera, BOOL forceVBOUpdate)
 		sUnderWaterRender = FALSE;
 	}
 
-	gGL.getTexUnit(0)->bind(LLViewerFetchedTexture::sDefaultImagep);
-	LLViewerFetchedTexture::sDefaultImagep->setAddressMode(LLTexUnit::TAM_WRAP);
-	
+	if (LLViewerFetchedTexture::sDefaultImagep)
+	{
+		gGL.getTexUnit(0)->bind(LLViewerFetchedTexture::sDefaultImagep);
+		LLViewerFetchedTexture::sDefaultImagep->setAddressMode(LLTexUnit::TAM_WRAP);
+	}
 
 	//////////////////////////////////////////////
 	//