On line 107 more or less, the center is currently calculated by adding start and stop and dividing the result by 2. This is prone to overflow, it is better to calculate the center like this:
center = minmaxStart.first->start + (minmaxStart.first->stop - minmaxStop.second->start) / 2;
This will never overflow.