In gimphistogram.c there is a function to calculate the histogram for a subregion, declared as follows:
gimp_histogram_calculate_sub_region (GimpHistogram *histogram, PixelRegion *region, PixelRegion *mask)
In that function we have this code snippet:
if (mask) { gdouble masked;
src = region->data; msrc = region->data;
I would think that msrc ought to be a pointer into the mask data instead of the region data, like this:
msrc = mask->data;
Regards, Roel Schroeven