Buffer overrun in NewtonTreeCollisionEndBuild()

Report any bugs here and we'll post fixes

Moderators: Sascha Willems, Thomas

Buffer overrun in NewtonTreeCollisionEndBuild()

Postby pHySiQuE » Mon Feb 06, 2012 1:15 am

This is not the cause of my problem. I have to make a demo with more debugging info.



----------------------------------------------------------------------------------
I finally traced a problem with the 300 library down to this. I get a "buffer overrun" error in Visual Studio 2008. Revision 1537.
Code: Select all
   float vertex[9];
   NewtonWorld* nw = NewtonCreate();
   NewtonCollision* nc = NewtonCreateTreeCollision(nw,0);
   NewtonTreeCollisionBeginBuild(nc);
   for (int i=0; i<500; i++)
   {
      NewtonTreeCollisionAddFace(nc,3,vertex,12,0);
   }
   NewtonTreeCollisionEndBuild(nc,0);
Last edited by pHySiQuE on Mon Feb 06, 2012 5:01 am, edited 1 time in total.
pHySiQuE
 
Posts: 608
Joined: Fri Sep 02, 2011 9:54 pm

Re: Buffer overrun in NewtonTreeCollisionEndBuild()

Postby Sweenie » Mon Feb 06, 2012 4:25 am

[Deleted]
Thought you had defined the vertexbuffer wrong but realized you hadn't. :roll:
Sweenie
 
Posts: 498
Joined: Mon Jan 24, 2005 7:59 am
Location: Sweden

Re: Buffer overrun in NewtonTreeCollisionEndBuild()

Postby pHySiQuE » Mon Feb 06, 2012 5:00 am

Damn, if you give it some more realistic values, it works:
Code: Select all
   float vertex[9] = {0.0,0.0,1.0, 0.0,1.0,0.0, 1.0,0.0,0.0};
   NewtonWorld* nw = NewtonCreate();
   NewtonCollision* nc = NewtonCreateTreeCollision(nw,0);
   NewtonTreeCollisionBeginBuild(nc);
   for (int i=0; i<500; i++)
   {
      vertex[0]+=1.0;
      vertex[3]+=1.0;
      vertex[6]+=1.0;
      NewtonTreeCollisionAddFace(nc,3,vertex,12,0);
   }
   NewtonTreeCollisionEndBuild(nc,0);

This will require further debugging. :cry:
pHySiQuE
 
Posts: 608
Joined: Fri Sep 02, 2011 9:54 pm

Re: Buffer overrun in NewtonTreeCollisionEndBuild()

Postby pHySiQuE » Mon Feb 06, 2012 4:01 pm

This is fixed. It wasn't really the cause at all.
pHySiQuE
 
Posts: 608
Joined: Fri Sep 02, 2011 9:54 pm


Return to Bugs and Fixes

Who is online

Users browsing this forum: No registered users and 8 guests

cron