diff --git a/src/libraries/Common/src/System/Text/OSEncoding.Windows.cs b/src/libraries/Common/src/System/Text/OSEncoding.Windows.cs index fc3f866ec96a6..4d3d91e423e45 100644 --- a/src/libraries/Common/src/System/Text/OSEncoding.Windows.cs +++ b/src/libraries/Common/src/System/Text/OSEncoding.Windows.cs @@ -168,7 +168,7 @@ public override int GetMaxCharCount(int byteCount) { ArgumentOutOfRangeException.ThrowIfNegative(byteCount); - long charCount = byteCount * 4; // Max possible value for all encodings + long charCount = (long)byteCount * 4; // Max possible value for all encodings if (charCount > 0x7fffffff) throw new ArgumentOutOfRangeException(nameof(byteCount), SR.ArgumentOutOfRange_GetCharCountOverflow);