diff --git a/modules/juce_opengl/native/juce_OpenGL_mac.h b/modules/juce_opengl/native/juce_OpenGL_mac.h index 6c865a5067..fb614caff3 100644 --- a/modules/juce_opengl/native/juce_OpenGL_mac.h +++ b/modules/juce_opengl/native/juce_OpenGL_mac.h @@ -180,7 +180,8 @@ public: // and sleeps if necessary. auto swapTime = Time::getMillisecondCounterHiRes() - now; - auto frameTime = (int) (now - lastSwapTime); + auto frameTime = (int) std::min ((uint64_t) std::numeric_limits::max(), + (uint64_t) now - (uint64_t) lastSwapTime); if (swapTime < 0.5 && frameTime < minSwapTime - 3) {