stevefsp / critterai

Archive of CAINav Project (Inactive)
MIT License
127 stars 75 forks source link

rcCompactHeightfield area pointer corruption #18

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
In a level which I will give you privately, CompactHeightfield::Build unity 
calls into the native nmcfBuildField which allocates the 
rcCompactHeightField.areas

chf.areas = (unsigned char*)rcAlloc(sizeof(unsigned char)*spanCount, 
RC_ALLOC_PERM);

However before it gets back to c#, Unity frees a bad block of memory which 
seems to cause the area pointer to get nulled.

I am at a loss tracking it down, I could do with a hand. The good news is that 
it is 100% reproducible on my machine at least.

Original issue reported on code.google.com by daniel.t...@gmail.com on 4 Aug 2011 at 5:57

GoogleCodeExporter commented 9 years ago
Sorry, this was all our fault, please close the bug.

One of our programmers fixed and unused variable warning by commenting out 

//private IntPtr mSpans = IntPtr.Zero;  // rcCompactSpan[spanCount]

in CompactHeightfield! Whoops

Original comment by daniel.t...@gmail.com on 4 Aug 2011 at 7:57

GoogleCodeExporter commented 9 years ago
Closed on submitters request.

Original comment by steve...@gmail.com on 4 Aug 2011 at 1:17