Avoid bad memory access in LOD texture failure case, ref ryzom/ryzomcore_graphics#22

develop
kaetemi 5 years ago
parent 67b74ad2b7
commit e020c9f0d0

@ -979,6 +979,9 @@ void CLodCharacterManager::addTextureCompute(CLodCharacterInstance &instance,
// get lookup ptr.
nlassert(lodTexture.Texture.size()==NL3D_CLOD_TEXT_SIZE);
if (lodTexture.Texture.size() < NL3D_CLOD_TEXT_SIZE)
return;
const CLodCharacterTexture::CTUVQ *lookUpPtr= &lodTexture.Texture[0];
// apply the lodTexture, taking only better quality (ie nearer 0)

@ -135,6 +135,9 @@ bool CLodTextureBuilder::computeTexture(const CMeshMRM &meshMRM, NL3D::CLodCha
const uint8 *srcPos= (const uint8*)vba.getVertexCoordPointer();
const uint8 *srcNormal= (const uint8*)vba.getNormalCoordPointer();
const uint8 *srcUV= (const uint8*)vba.getTexCoordPointer();
nlassert(srcPos);
nlassert(srcNormal);
nlassert(srcUV);
uint vertexSize = VB.getVertexSize();
// For the more precise lod
uint lodId= meshMRM.getNbLod()-1;

Loading…
Cancel
Save