By running valgrind I have come across several memory erros, e.g. in the
function cdelete() in ipSegmentationCombineRegion.c. It causes following
error:
28165== Source and destination overlap in memcpy(0x10E48474,
0x10E48488, 60)
28165== at 0x4024959: memcpy (mc_replace_strmem.c:402)
28165== by 0xB2C33D8: cdelete (in
/scratch/blloyd/mitk-svn-build/bin/libipSegmentation.so)
28165== by 0xB2C4B70: ipMITKSegmentationCombineRegion (in
This can be fixed by replacing "memcpy" by "memmove", which is the
suggested "official" replacement for "bcopy".
http://www.opengroup.org/onlinepubs/000095399/functions/bcopy.html
ipSegmentationCombineRegion.c, Line 161:
static void cdelete(i) /* remove edge i from active list */
int i;
{
int j; for (j=0; j<nact && active[j].i!=i; j++); if (j>=nact) return; /* edge not in active list; happens at win->y0*/ nact--; //bcopy(&active[j+1], &active[j], (nact-j)*sizeof active[0]);
DEPRECATED!
memmove(&active[j], &active[j+1], (nact-j)*sizeof active[0]); //
instead of memcpy
}