NVIDIAGameWorks / PhysX-3.4

NVIDIA PhysX SDK 3.4
https://www.nvidia.com/
2.35k stars 274 forks source link

Memory Corruption in PxTaskMgr::dispatchTask() when using APEX Cloth #30

Closed PeterDalton closed 7 years ago

PeterDalton commented 7 years ago

There is a reference pulled out of a vector type class at the top of the function:

PxTaskTableRow & tt = mTaskTable[ taskID ];

Next the task is sumbitted using:

mCpuDispatcher->submitTask( *tt.mTask );

In the case of using APEX cloth new tasks can be added to the task manager causing the vector to be resized. At the end of the PxTaskManager::dispatchTask() routine it uses the reference to set the type which stomps memory that was released by the vector class.

tt.mType = PxTaskType::TT_COMPLETED;

Simple fix is to change the line to: mTaskTable[taskID].mType = PxTaskType::TT_COMPLETED;

ibychkov commented 7 years ago

Thank you for reporting. We fixed it in our internal sources. It should be merged to github after some time.