commit 60d8fad8905261c6de491b67a584e21ca6c05087
parent c255436ab65e5eb0364e2385b279354291a0172b
Author: falkTX <falktx@gmail.com>
Date: Tue, 29 Mar 2016 11:54:42 +0200
Limit String base64 stack size
Diffstat:
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/distrho/extra/String.hpp b/distrho/extra/String.hpp
@@ -19,6 +19,8 @@
#include "../DistrhoUtils.hpp"
+#include <algorithm>
+
START_NAMESPACE_DISTRHO
// -----------------------------------------------------------------------
@@ -577,7 +579,7 @@ public:
"abcdefghijklmnopqrstuvwxyz"
"0123456789+/";
- const std::size_t kTmpBufSize = d_nextPowerOf2(dataSize/3);
+ const std::size_t kTmpBufSize = std::min(d_nextPowerOf2(dataSize/3), 65536U);
const uchar* bytesToEncode((const uchar*)data);