@@ -1,4 +1,5 @@
#include "Base64.h"
+#include <math.h>
using namespace Framework;
@@ -62,7 +63,7 @@ bool Framework::base64Decode(Text base64, char** data, int* length)
return false;
l++;
}
- *length = (l * 3) / 4;
+ *length = (int)ceil(l / 4.f) * 3;
*data = new char[*length + 1];
while (base64[k])
{