diff --git a/modules/juce_core/maths/juce_BigInteger.cpp b/modules/juce_core/maths/juce_BigInteger.cpp index 609b69d1e8..9d336d2f12 100644 --- a/modules/juce_core/maths/juce_BigInteger.cpp +++ b/modules/juce_core/maths/juce_BigInteger.cpp @@ -221,7 +221,7 @@ int64 BigInteger::toInt64() const noexcept BigInteger BigInteger::getBitRange (int startBit, int numBits) const { BigInteger r; - numBits = jmin (numBits, getHighestBit() + 1 - startBit); + numBits = jmax (0, jmin (numBits, getHighestBit() + 1 - startBit)); auto* destValues = r.ensureSize (sizeNeededToHold (numBits)); r.highestBit = numBits;