From 2919e51d9d93b17cab575e45f1564d8f1cf41a00 Mon Sep 17 00:00:00 2001 From: erwincoumans Date: Sun, 17 Sep 2017 15:44:14 -0700 Subject: [PATCH] fix loading of empty file (after header) remove debug printf --- Extras/Serialize/BulletFileLoader/btBulletFile.cpp | 3 +++ examples/SharedMemory/SharedMemoryInProcessPhysicsC_API.cpp | 1 - 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Extras/Serialize/BulletFileLoader/btBulletFile.cpp b/Extras/Serialize/BulletFileLoader/btBulletFile.cpp index 18cb15321..aa1c383fd 100644 --- a/Extras/Serialize/BulletFileLoader/btBulletFile.cpp +++ b/Extras/Serialize/BulletFileLoader/btBulletFile.cpp @@ -128,6 +128,9 @@ void btBulletFile::parseData() mDataStart = 12; remain-=12; + //invalid/empty file? + if (remain < sizeof(bChunkInd)) + return; char *dataPtr = mFileBuffer+mDataStart; diff --git a/examples/SharedMemory/SharedMemoryInProcessPhysicsC_API.cpp b/examples/SharedMemory/SharedMemoryInProcessPhysicsC_API.cpp index e8d43c8b1..b82d550a6 100644 --- a/examples/SharedMemory/SharedMemoryInProcessPhysicsC_API.cpp +++ b/examples/SharedMemory/SharedMemoryInProcessPhysicsC_API.cpp @@ -184,7 +184,6 @@ public: // return non-null if there is a status, nullptr otherwise virtual const struct SharedMemoryStatus* processServerStatus() { - printf("updating graphics!\n"); m_physicsServerExample->updateGraphics(); unsigned long long int curTime = m_clock.getTimeMicroseconds();