diff options
| author | andreykproductengine <akleshchev@productengine.com> | 2016-09-15 19:22:10 +0300 | 
|---|---|---|
| committer | andreykproductengine <akleshchev@productengine.com> | 2016-09-15 19:22:10 +0300 | 
| commit | f0c469b649feb2f94b07377faeb87e27fa3041a4 (patch) | |
| tree | 6b75fe721cdd7d56a5b58daa408eaafb0324dd36 /indra/newview | |
| parent | 8c5e92a399dde318b08549dc3ab7fe20152ab336 (diff) | |
MAINT-6734 Fixed processData() crash in LLMeshHeaderHandler
Diffstat (limited to 'indra/newview')
| -rw-r--r-- | indra/newview/llmeshrepository.cpp | 30 | 
1 files changed, 26 insertions, 4 deletions
| diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp index f9461e3132..e42647739f 100644 --- a/indra/newview/llmeshrepository.cpp +++ b/indra/newview/llmeshrepository.cpp @@ -3015,12 +3015,23 @@ void LLMeshHeaderHandler::processData(LLCore::BufferArray * /* body */, S32 /* b  	}  	else if (data && data_size > 0)  	{ -		// header was successfully retrieved from sim, cache in vfs -		LLSD header = gMeshRepo.mThread->mMeshHeader[mesh_id]; +		// header was successfully retrieved from sim and parsed, cache in vfs +		S32 header_bytes = 0; +		LLSD header; -		S32 version = header["version"].asInteger(); +		gMeshRepo.mThread->mHeaderMutex->lock(); +		LLMeshRepoThread::mesh_header_map::iterator iter = gMeshRepo.mThread->mMeshHeader.find(mesh_id); +		if (iter != gMeshRepo.mThread->mMeshHeader.end()) +		{ +			header_bytes = (S32)gMeshRepo.mThread->mMeshHeaderSize[mesh_id]; +			header = iter->second; +		} +		gMeshRepo.mThread->mHeaderMutex->unlock(); -		if (version <= MAX_MESH_VERSION) +		if (header_bytes > 0 +			&& !header.has("404") +			&& header.has("version") +			&& header["version"].asInteger() <= MAX_MESH_VERSION)  		{  			std::stringstream str; @@ -3069,6 +3080,17 @@ void LLMeshHeaderHandler::processData(LLCore::BufferArray * /* body */, S32 /* b  				}  			}  		} +		else +		{ +			LL_WARNS(LOG_MESH) << "Trying to cache nonexistent mesh, mesh id: " << mesh_id << LL_ENDL; + +			// headerReceived() parsed header, but header's data is invalid so none of the LODs will be available +			LLMutexLock lock(gMeshRepo.mThread->mMutex); +			for (int i(0); i < 4; ++i) +			{ +				gMeshRepo.mThread->mUnavailableQ.push(LLMeshRepoThread::LODRequest(mMeshParams, i)); +			} +		}  	}  } | 
