mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-19 20:53:52 +00:00
Fix passing null to memcpy
/home/elsid/dev/openmw/components/detournavigator/navmeshtilescache.cpp:36:24: runtime error: null pointer passed as argument 2, which is declared to never be null #0 0x55e37ba4cda5 in makeNavMeshKey /home/elsid/dev/openmw/components/detournavigator/navmeshtilescache.cpp:36 #1 0x55e37ba4cda5 in DetourNavigator::NavMeshTilesCache::set(osg::Vec3f const&, osg::Vec2i const&, DetourNavigator::RecastMesh const&, std::vector<DetourNavigator::OffMeshConnection, std::allocator<DetourNavigator::OffMeshConnection> > const&, DetourNavigator::NavMeshData&&) /home/elsid/dev/openmw/components/detournavigator/navmeshtilescache.cpp:81 #2 0x55e37fe3c861 in DetourNavigator::updateNavMesh(osg::Vec3f const&, DetourNavigator::RecastMesh const*, osg::Vec2i const&, osg::Vec2i const&, std::vector<DetourNavigator::OffMeshConnection, std::allocator<DetourNavigator::OffMeshConnection> > const&, DetourNavigator::Settings const&, std::shared_ptr<Misc::ScopeGuarded<DetourNavigator::NavMeshCacheItem> > const&, DetourNavigator::NavMeshTilesCache&) /home/elsid/dev/openmw/components/detournavigator/makenavmesh.cpp:582 #3 0x55e37fb796ce in DetourNavigator::AsyncNavMeshUpdater::processJob(DetourNavigator::AsyncNavMeshUpdater::Job const&) /home/elsid/dev/openmw/components/detournavigator/asyncnavmeshupdater.cpp:178 #4 0x55e37fb9a125 in DetourNavigator::AsyncNavMeshUpdater::process() /home/elsid/dev/openmw/components/detournavigator/asyncnavmeshupdater.cpp:144 #5 0x7f013f585c23 in execute_native_thread_routine /build/gcc/src/gcc/libstdc++-v3/src/c++11/thread.cc:80 #6 0x7f013f8c63e8 in start_thread (/usr/lib/libpthread.so.0+0x93e8) #7 0x7f013e91d292 in __GI___clone (/usr/lib/libc.so.6+0x100292)
This commit is contained in:
parent
7b54415c40
commit
d2d8a7a940
1 changed files with 22 additions and 9 deletions
|
@ -21,19 +21,32 @@ namespace DetourNavigator
|
||||||
std::vector<unsigned char> result(indicesSize + verticesSize + areaTypesSize + waterSize + offMeshConnectionsSize);
|
std::vector<unsigned char> result(indicesSize + verticesSize + areaTypesSize + waterSize + offMeshConnectionsSize);
|
||||||
unsigned char* dst = result.data();
|
unsigned char* dst = result.data();
|
||||||
|
|
||||||
std::memcpy(dst, recastMesh.getIndices().data(), indicesSize);
|
if (indicesSize > 0)
|
||||||
dst += indicesSize;
|
{
|
||||||
|
std::memcpy(dst, recastMesh.getIndices().data(), indicesSize);
|
||||||
|
dst += indicesSize;
|
||||||
|
}
|
||||||
|
|
||||||
std::memcpy(dst, recastMesh.getVertices().data(), verticesSize);
|
if (verticesSize > 0)
|
||||||
dst += verticesSize;
|
{
|
||||||
|
std::memcpy(dst, recastMesh.getVertices().data(), verticesSize);
|
||||||
|
dst += verticesSize;
|
||||||
|
}
|
||||||
|
|
||||||
std::memcpy(dst, recastMesh.getAreaTypes().data(), areaTypesSize);
|
if (areaTypesSize > 0)
|
||||||
dst += areaTypesSize;
|
{
|
||||||
|
std::memcpy(dst, recastMesh.getAreaTypes().data(), areaTypesSize);
|
||||||
|
dst += areaTypesSize;
|
||||||
|
}
|
||||||
|
|
||||||
std::memcpy(dst, recastMesh.getWater().data(), waterSize);
|
if (waterSize > 0)
|
||||||
dst += waterSize;
|
{
|
||||||
|
std::memcpy(dst, recastMesh.getWater().data(), waterSize);
|
||||||
|
dst += waterSize;
|
||||||
|
}
|
||||||
|
|
||||||
std::memcpy(dst, offMeshConnections.data(), offMeshConnectionsSize);
|
if (offMeshConnectionsSize > 0)
|
||||||
|
std::memcpy(dst, offMeshConnections.data(), offMeshConnectionsSize);
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue