added checks for valid pointers after locking

This commit is contained in:
Thomas Fischer 2013-06-30 17:51:38 +02:00
parent 95ef5ec226
commit 53abbe066d
13 changed files with 39 additions and 10 deletions

View file

@ -219,8 +219,12 @@ void TerrainBlock::_updateBaseTexture( bool writeToCache )
points[3].texCoord = Point2F( 1.0, needsYFlip ? 0.0f : 1.0f );
vb.set( GFX, 4, GFXBufferTypeVolatile );
dMemcpy( vb.lock(), points, sizeof(GFXVertexPT) * 4 );
vb.unlock();
GFXVertexPT *ptr = vb.lock();
if(ptr)
{
dMemcpy( ptr, points, sizeof(GFXVertexPT) * 4 );
vb.unlock();
}
}
GFXTexHandle blendTex;