diff --git a/indra/llmath/llvolume.cpp b/indra/llmath/llvolume.cpp
index c6ceaefcbe34326a9fb5dcd474e52bb544981e7c..3c7f94396b0efb6a646f92b53675feac1b8264a1 100644
--- a/indra/llmath/llvolume.cpp
+++ b/indra/llmath/llvolume.cpp
@@ -2142,7 +2142,7 @@ BOOL LLVolume::generate()
 	F32 profile_detail = mDetail;
 	F32 path_detail = mDetail;
 
-	if ((mParams.getSculptType() & LL_SCULPT_TYPE_MASK) != LL_SCULPT_TYPE_MESH)
+	if (!mParams.isMeshSculpt())
 	{
 		U8 path_type = mParams.getPathParams().getCurveType();
 		U8 profile_type = mParams.getProfileParams().getCurveType();
diff --git a/indra/newview/llappviewerwin32.cpp b/indra/newview/llappviewerwin32.cpp
index 6598f537702de01d65f7470408042e6447f56f1c..1c3d9f48963b412efda2df53e79d15dbe5a5ad21 100644
--- a/indra/newview/llappviewerwin32.cpp
+++ b/indra/newview/llappviewerwin32.cpp
@@ -216,35 +216,8 @@ int APIENTRY WINMAIN(HINSTANCE hInstance,
                      LPSTR     lpCmdLine,
                      int       nCmdShow)
 {
-	const S32 MAX_HEAPS = 255;
-	DWORD heap_enable_lfh_error[MAX_HEAPS];
-	S32 num_heaps = 0;
-	
 #if WINDOWS_CRT_MEM_CHECKS && !INCLUDE_VLD
 	_CrtSetDbgFlag ( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF ); // dump memory leaks on exit
-#elif 0
-	// Experimental - enable the low fragmentation heap
-	// This results in a 2-3x improvement in opening a new Inventory window (which uses a large numebr of allocations)
-	// Note: This won't work when running from the debugger unless the _NO_DEBUG_HEAP environment variable is set to 1
-
-	// Enable to get mem debugging within visual studio.
-#if LL_DEBUG
-	_CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF);
-#else
-	_CrtSetDbgFlag(0); // default, just making explicit
-	
-	ULONG ulEnableLFH = 2;
-	HANDLE* hHeaps = new HANDLE[MAX_HEAPS];
-	num_heaps = GetProcessHeaps(MAX_HEAPS, hHeaps);
-	for(S32 i = 0; i < num_heaps; i++)
-	{
-		bool success = HeapSetInformation(hHeaps[i], HeapCompatibilityInformation, &ulEnableLFH, sizeof(ulEnableLFH));
-		if (success)
-			heap_enable_lfh_error[i] = 0;
-		else
-			heap_enable_lfh_error[i] = GetLastError();
-	}
-#endif
 #endif
 	
 	LLAppViewerWin32* viewer_app_ptr = new LLAppViewerWin32(lpCmdLine);
@@ -291,19 +264,7 @@ int APIENTRY WINMAIN(HINSTANCE hInstance,
 	}
 #endif
 
-	// Have to wait until after logging is initialized to display LFH info
-	if (num_heaps > 0)
-	{
-		LL_INFOS() << "Attempted to enable LFH for " << num_heaps << " heaps." << LL_ENDL;
-		for(S32 i = 0; i < num_heaps; i++)
-		{
-			if (heap_enable_lfh_error[i])
-			{
-				LL_INFOS() << "  Failed to enable LFH for heap: " << i << " Error: " << heap_enable_lfh_error[i] << LL_ENDL;
-			}
-		}
-	}
-	
+
 	// Run the application main loop
 	while (! viewer_app_ptr->frame()) 
 	{}
diff --git a/indra/newview/llsidepaneltaskinfo.cpp b/indra/newview/llsidepaneltaskinfo.cpp
index 7fbb5760e72a74a1aa9b102f967c450bfdd8a572..f10667f12f21415e0bdd28459e38f91d70381dae 100644
--- a/indra/newview/llsidepaneltaskinfo.cpp
+++ b/indra/newview/llsidepaneltaskinfo.cpp
@@ -485,20 +485,14 @@ void LLSidepanelTaskInfo::refresh()
 	BOOL groups_identical = LLSelectMgr::getInstance()->selectGetGroup(group_id);
 	if (groups_identical)
 	{
-		if (mGroupNameBox)
-		{
-			mGroupNameBox->setNameID(group_id,TRUE);
-			mGroupNameBox->setEnabled(TRUE);
-		}
+		mGroupNameBox->setNameID(group_id,TRUE);
+		mGroupNameBox->setEnabled(TRUE);
 	}
 	else
 	{
-		if (mGroupNameBox)
-		{
-			mGroupNameBox->setNameID(LLUUID::null, TRUE);
-			mGroupNameBox->refresh(LLUUID::null, std::string(), true);
-			mGroupNameBox->setEnabled(FALSE);
-		}
+		mGroupNameBox->setNameID(LLUUID::null, TRUE);
+		mGroupNameBox->refresh(LLUUID::null, std::string(), true);
+		mGroupNameBox->setEnabled(FALSE);
 	}
 	
 	mGroupSetButton->setEnabled(owners_identical && (mOwnerID == gAgent.getID()) && is_nonpermanent_enforced);
@@ -968,10 +962,7 @@ void LLSidepanelTaskInfo::onClickGroup()
 
 void LLSidepanelTaskInfo::cbGroupID(LLUUID group_id)
 {
-	if (mGroupNameBox)
-	{
-		mGroupNameBox->setNameID(group_id, TRUE);
-	}
+	mGroupNameBox->setNameID(group_id, TRUE);
 	LLSelectMgr::getInstance()->sendGroup(group_id);
 }
 
diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp
index 0a336c0c79f4c69adffda339c47ef103a3fced42..54803814ad0356d70d0bbe682b68daddf285a6e6 100644
--- a/indra/newview/llviewerobject.cpp
+++ b/indra/newview/llviewerobject.cpp
@@ -5582,7 +5582,7 @@ void LLViewerObject::parameterChanged(U16 param_type, LLNetworkData* data, BOOL
 		if(!regionp) return;
 
 		// Change happened on the viewer. Send the change up
-		U8 tmp[MAX_OBJECT_PARAMS_SIZE];
+		U8 tmp[MAX_OBJECT_PARAMS_SIZE] = {};
 		LLDataPackerBinaryBuffer dpb(tmp, MAX_OBJECT_PARAMS_SIZE);
 		if (data->pack(dpb))
 		{
diff --git a/indra/newview/llviewerobjectlist.cpp b/indra/newview/llviewerobjectlist.cpp
index d9d8ef91255a6a60060b398b7dec4f32dcedaae3..fde4c972213722713a7d157666b10ddc6d9f8a75 100644
--- a/indra/newview/llviewerobjectlist.cpp
+++ b/indra/newview/llviewerobjectlist.cpp
@@ -1330,19 +1330,19 @@ void LLViewerObjectList::removeDrawable(LLDrawable* drawablep)
 
 BOOL LLViewerObjectList::killObject(LLViewerObject *objectp)
 {
-	// Don't ever kill gAgentAvatarp, just force it to the agent's region
-	// unless region is NULL which is assumed to mean you are logging out.
-	if ((objectp == gAgentAvatarp) && gAgent.getRegion())
+	if (objectp)
 	{
-		objectp->setRegion(gAgent.getRegion());
-		return FALSE;
-	}
+		// Don't ever kill gAgentAvatarp, just force it to the agent's region
+		// unless region is NULL which is assumed to mean you are logging out.
+		if ((objectp == gAgentAvatarp) && gAgent.getRegion())
+		{
+			objectp->setRegion(gAgent.getRegion());
+			return FALSE;
+		}
 
-	// When we're killing objects, all we do is mark them as dead.
-	// We clean up the dead objects later.
+		// When we're killing objects, all we do is mark them as dead.
+		// We clean up the dead objects later.
 
-	if (objectp)
-	{
 		objectp->markDead(); // does the right thing if object already dead
 		return TRUE;
 	}
diff --git a/indra/newview/llviewerthrottle.cpp b/indra/newview/llviewerthrottle.cpp
index 2d1c5472d382249b97a6f520edf88a96cc206eda..e48d1f36579f020356dea5310dfd099717a4dd53 100644
--- a/indra/newview/llviewerthrottle.cpp
+++ b/indra/newview/llviewerthrottle.cpp
@@ -161,7 +161,7 @@ void LLViewerThrottleGroup::sendToSim() const
 	msg->addU32Fast(_PREHASH_GenCounter, 0);
 
 	// Pack up the throttle data
-	U8 tmp[64];
+	U8 tmp[64] = {};
 	LLDataPackerBinaryBuffer dp(tmp, MAX_THROTTLE_SIZE);
 	S32 i;
 	for (i = 0; i < TC_EOF; i++)
diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp
index e202fd42b3f2cde66d0cc9ac313d877de00d7f10..e78dbc2fd9fc8e3a2e720a50de61d7f27e31f525 100644
--- a/indra/newview/llviewerwindow.cpp
+++ b/indra/newview/llviewerwindow.cpp
@@ -1119,78 +1119,80 @@ LLWindowCallbacks::DragNDropResult LLViewerWindow::handleDragNDrop( LLWindow *wi
 					{
 						LLTextureEntry *te = obj->getTE(object_face);
 
-						// can modify URL if we can modify the object or we have navigate permissions
-						bool allow_modify_url = obj->permModify() || obj->hasMediaPermission( te->getMediaData(), LLVOVolume::MEDIA_PERM_INTERACT );
-
-						if (te && allow_modify_url )
+						if (te)
 						{
-							if (drop)
+							// can modify URL if we can modify the object or we have navigate permissions
+							bool allow_modify_url = obj->permModify() || obj->hasMediaPermission(te->getMediaData(), LLVOVolume::MEDIA_PERM_INTERACT);
+							if (allow_modify_url)
 							{
-								// object does NOT have media already
-								if ( ! te->hasMedia() )
-								{
-									// we are allowed to modify the object
-									if ( obj->permModify() )
-									{
-										// Create new media entry
-										LLSD media_data;
-										// XXX Should we really do Home URL too?
-										media_data[LLMediaEntry::HOME_URL_KEY] = url;
-										media_data[LLMediaEntry::CURRENT_URL_KEY] = url;
-										media_data[LLMediaEntry::AUTO_PLAY_KEY] = true;
-										obj->syncMediaData(object_face, media_data, true, true);
-										// XXX This shouldn't be necessary, should it ?!?
-										if (obj->getMediaImpl(object_face))
-											obj->getMediaImpl(object_face)->navigateReload();
-										obj->sendMediaDataUpdate();
-
-										result = LLWindowCallbacks::DND_COPY;
-									}
-								}
-								else 
-								// object HAS media already
+								if (drop)
 								{
-									// URL passes the whitelist
-									if (te->getMediaData()->checkCandidateUrl( url ) )
+									// object does NOT have media already
+									if (!te->hasMedia())
 									{
-										// just navigate to the URL
-										if (obj->getMediaImpl(object_face))
+										// we are allowed to modify the object
+										if (obj->permModify())
 										{
-											obj->getMediaImpl(object_face)->navigateTo(url);
-										}
-										else 
-										{
-											// This is very strange.  Navigation should
-											// happen via the Impl, but we don't have one.
-											// This sends it to the server, which /should/
-											// trigger us getting it.  Hopefully.
+											// Create new media entry
 											LLSD media_data;
+											// XXX Should we really do Home URL too?
+											media_data[LLMediaEntry::HOME_URL_KEY] = url;
 											media_data[LLMediaEntry::CURRENT_URL_KEY] = url;
+											media_data[LLMediaEntry::AUTO_PLAY_KEY] = true;
 											obj->syncMediaData(object_face, media_data, true, true);
+											// XXX This shouldn't be necessary, should it ?!?
+											if (obj->getMediaImpl(object_face))
+												obj->getMediaImpl(object_face)->navigateReload();
 											obj->sendMediaDataUpdate();
+
+											result = LLWindowCallbacks::DND_COPY;
+										}
+									}
+									else
+										// object HAS media already
+									{
+										// URL passes the whitelist
+										if (te->getMediaData()->checkCandidateUrl(url))
+										{
+											// just navigate to the URL
+											if (obj->getMediaImpl(object_face))
+											{
+												obj->getMediaImpl(object_face)->navigateTo(url);
+											}
+											else
+											{
+												// This is very strange.  Navigation should
+												// happen via the Impl, but we don't have one.
+												// This sends it to the server, which /should/
+												// trigger us getting it.  Hopefully.
+												LLSD media_data;
+												media_data[LLMediaEntry::CURRENT_URL_KEY] = url;
+												obj->syncMediaData(object_face, media_data, true, true);
+												obj->sendMediaDataUpdate();
+											}
+											result = LLWindowCallbacks::DND_LINK;
+
 										}
-										result = LLWindowCallbacks::DND_LINK;
-										
 									}
+									LLSelectMgr::getInstance()->unhighlightObjectOnly(mDragHoveredObject);
+									mDragHoveredObject = nullptr;
+
 								}
-								LLSelectMgr::getInstance()->unhighlightObjectOnly(mDragHoveredObject);
-								mDragHoveredObject = nullptr;
-							
-							}
-							else 
-							{
-								// Check the whitelist, if there's media (otherwise just show it)
-								if (te->getMediaData() == nullptr || te->getMediaData()->checkCandidateUrl(url))
+								else
 								{
-									if ( obj != mDragHoveredObject)
+									// Check the whitelist, if there's media (otherwise just show it)
+									if (te->getMediaData() == nullptr || te->getMediaData()->checkCandidateUrl(url))
 									{
-										// Highlight the dragged object
-										LLSelectMgr::getInstance()->unhighlightObjectOnly(mDragHoveredObject);
-										mDragHoveredObject = obj;
-										LLSelectMgr::getInstance()->highlightObjectOnly(mDragHoveredObject);
-									}
-									result = (! te->hasMedia()) ? LLWindowCallbacks::DND_COPY : LLWindowCallbacks::DND_LINK;
+										if (obj != mDragHoveredObject)
+										{
+											// Highlight the dragged object
+											LLSelectMgr::getInstance()->unhighlightObjectOnly(mDragHoveredObject);
+											mDragHoveredObject = obj;
+											LLSelectMgr::getInstance()->highlightObjectOnly(mDragHoveredObject);
+										}
+										result = (!te->hasMedia()) ? LLWindowCallbacks::DND_COPY : LLWindowCallbacks::DND_LINK;
 
+									}
 								}
 							}
 						}
@@ -1991,7 +1993,9 @@ void LLViewerWindow::initWorldUI()
 	gStatusBar->setFollows(FOLLOWS_ALL);
 	gStatusBar->setShape(mStatusBarPanel.get()->getLocalRect());
 	// sync bg color with menu bar
-	gStatusBar->setBackgroundColor( gMenuBarView->getBackgroundColor().get() );
+	if (gMenuBarView) {
+		gStatusBar->setBackgroundColor(gMenuBarView->getBackgroundColor().get());
+	}
 	mStatusBarPanel.get()->addChildInBack(gStatusBar);
 	mStatusBarPanel.get()->setVisible(TRUE);
 
@@ -2000,7 +2004,9 @@ void LLViewerWindow::initWorldUI()
 
 	LLNavigationBar* navbar = LLNavigationBar::getInstance();
 	navbar->setShape(nav_bar_container->getLocalRect());
-	navbar->setBackgroundColor(gMenuBarView->getBackgroundColor().get());
+	if (gMenuBarView) {
+		navbar->setBackgroundColor(gMenuBarView->getBackgroundColor().get());
+	}
 	nav_bar_container->addChild(navbar);
 	nav_bar_container->setVisible(TRUE);
 	
@@ -5384,6 +5390,7 @@ LLPickInfo::LLPickInfo()
 	  mPickTransparent(FALSE),
 	  mPickRigged(FALSE),
 	  mPickParticle(FALSE),
+	  mPickUnselectable(FALSE),
 	  mWantSurfaceInfo(FALSE)
 {
 }
diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp
index 98100a6739dc2d1249198a025ebca6c62b77914b..1561b5ecad7c3d8822362576bbaae755ee573ed3 100644
--- a/indra/newview/llvoavatar.cpp
+++ b/indra/newview/llvoavatar.cpp
@@ -239,7 +239,8 @@ struct LLAppearanceMessageContents: public LLRefCount
 	LLAppearanceMessageContents():
 		mAppearanceVersion(-1),
 		mParamAppearanceVersion(-1),
-		mCOFVersion(LLViewerInventoryCategory::VERSION_UNKNOWN)
+		mCOFVersion(LLViewerInventoryCategory::VERSION_UNKNOWN),
+		mHoverOffsetWasSet(false)
 	{
 	}
 	LLTEContents mTEContents;
diff --git a/indra/newview/llvocache.cpp b/indra/newview/llvocache.cpp
index d55010b822c862d67e47d99f2d9900680943947c..f3daec4a0ee197eedbafc4fa1705539eca650c6a 100644
--- a/indra/newview/llvocache.cpp
+++ b/indra/newview/llvocache.cpp
@@ -64,6 +64,7 @@ BOOL check_write(LLAPRFile* apr_file, void* src, S32 n_bytes)
 LLVOCacheEntry::LLVOCacheEntry(U32 local_id, U32 crc, LLDataPackerBinaryBuffer &dp)
 :	LLViewerOctreeEntryData(LLViewerOctreeEntry::LLVOCACHEENTRY),
 	LLTrace::MemTrackable<LLVOCacheEntry, 16>("LLVOCacheEntry"),
+	mLastCameraUpdated(0),
 	mLocalID(local_id),
 	mParentID(0),
 	mCRC(crc),
@@ -84,6 +85,7 @@ LLVOCacheEntry::LLVOCacheEntry(U32 local_id, U32 crc, LLDataPackerBinaryBuffer &
 LLVOCacheEntry::LLVOCacheEntry()
 :	LLViewerOctreeEntryData(LLViewerOctreeEntry::LLVOCACHEENTRY),
 	LLTrace::MemTrackable<LLVOCacheEntry, 16>("LLVOCacheEntry"),
+	mLastCameraUpdated(0),
 	mLocalID(0),
 	mParentID(0),
 	mCRC(0),
@@ -103,6 +105,7 @@ LLVOCacheEntry::LLVOCacheEntry()
 LLVOCacheEntry::LLVOCacheEntry(LLAPRFile* apr_file)
 :	LLViewerOctreeEntryData(LLViewerOctreeEntry::LLVOCACHEENTRY),
 	LLTrace::MemTrackable<LLVOCacheEntry, 16>("LLVOCacheEntry"), 
+	mLastCameraUpdated(0),
 	mParentID(0),
 	mUpdateFlags(-1),
 	mBuffer(nullptr),