MAINT-8064 Crashes in lodReceived() default

Fri, 15 Dec 2017 19:41:34 +0200

author
andreykproductengine <andreykproductengine@lindenlab.com>
date
Fri, 15 Dec 2017 19:41:34 +0200
changeset 53577
03862413c3bc
parent 53576
00d6bd90bdb0
child 53578
e2b9802ae72c

MAINT-8064 Crashes in lodReceived()

indra/newview/llmeshrepository.cpp file | annotate | diff | revisions
     1.1 --- a/indra/newview/llmeshrepository.cpp	Mon Dec 11 13:50:24 2017 +0000
     1.2 +++ b/indra/newview/llmeshrepository.cpp	Fri Dec 15 19:41:34 2017 +0200
     1.3 @@ -1817,8 +1817,17 @@
     1.4  	}
     1.5  
     1.6  	LLPointer<LLVolume> volume = new LLVolume(mesh_params, LLVolumeLODGroup::getVolumeScaleFromDetail(lod));
     1.7 -	std::string mesh_string((char*) data, data_size);
     1.8 -	std::istringstream stream(mesh_string);
     1.9 +	std::istringstream stream;
    1.10 +	try
    1.11 +	{
    1.12 +		std::string mesh_string((char*)data, data_size);
    1.13 +		stream.str(mesh_string);
    1.14 +	}
    1.15 +	catch (std::bad_alloc)
    1.16 +	{
    1.17 +		// out of memory, we won't be able to process this mesh
    1.18 +		return false;
    1.19 +	}
    1.20  
    1.21  	if (volume->unpackVolumeFaces(stream, data_size))
    1.22  	{

mercurial