LIDS-UNICAMP/SICLE

Failure on valgrind check

Opened this issue · 2 comments

Hi, Felipe. I ran a valgrind check in my code, and somehow there was an invalid read in the function iftSICLE_CalcTStats.

This is a snippet of the code that I used:

iftSICLEArgs *sargs;
iftSICLE *sicle;

sargs = iftCreateSICLEArgs();
sargs->n0 = num_init_seeds;
sargs->nf = num_superpixels;
//sargs->connopt = IFT_SICLE_CONN_FSUM;

sicle = iftCreateSICLE(img, NULL, p_mask);
v_mask = iftRunSICLE(sicle, sargs);
iftDestroySICLEArgs(&sargs);
iftDestroySICLE(&sicle);

num_init_seeds was 15800 and num_superpixels was 800. The image and mask are volumetric.

I think data->root_map is nil for pixels outside the ROI.

The command iftSICLE_InROI(sicle, v_index) doesn't prevent that. Sometimes, some indexes are negative in the root map but still defined in the ROI.