How to handle audio buffer under/over flow?

Hi, I am just getting into JUCE C++ framework so my knowledge is limited. I have tried searching this topic but couldn’t get right results

My question is - what is the appropriate way to handle sample rate adjustment when an audio source is producing slightly less or more samples than its advertised sample rate? This is an error that accumulates over long duration, like 1+ hours. Does JUCE have framework to address this specific situation or is that something I have to do myself?