--- /Base64.java	2023-07-05 03:12:00.214027814 +0200
+++ /Codec-1/src/java/org/apache/commons/codec/binary/Base64.java	2023-07-05 03:12:00.214027814 +0200
@@ -286,7 +286,7 @@
 
             chunckCount = (CHUNK_SEPARATOR.length == 0 ? 0 : (int) Math
                     .ceil((float) encodedDataLengthLong / CHUNK_SIZE));
-            encodedDataLengthLong += chunckCount * CHUNK_SEPARATOR.length;
+encodedDataLengthLong +=  nextSeparatorIndex * CHUNK_SEPARATOR.length;
         }
 
         if (encodedDataLengthLong > Integer.MAX_VALUE) {
