Browse Source

Fix #380: Limit stack allocation during base64 encoding

Some VST plugins want to save a large binary chunk of state. For example,
Drumlab inside Kontakt 5 saves 1.5MB of data. We shouldn't allocate that
much on the stack.
tags/1.9.7
Jan Ypma 8 years ago
parent
commit
f40b74787d
1 changed files with 2 additions and 1 deletions
  1. +2
    -1
      source/utils/CarlaString.hpp

+ 2
- 1
source/utils/CarlaString.hpp View File

@@ -20,6 +20,7 @@

#include "CarlaJuceUtils.hpp"
#include "CarlaMathUtils.hpp"
#include <algorithm>

// -----------------------------------------------------------------------
// CarlaString class
@@ -585,7 +586,7 @@ public:
"abcdefghijklmnopqrstuvwxyz"
"0123456789+/";

const std::size_t kTmpBufSize = carla_nextPowerOf2(static_cast<uint32_t>(dataSize/3));
const std::size_t kTmpBufSize = std::min(carla_nextPowerOf2(static_cast<uint32_t>(dataSize/3)), 65536U);

const uchar* bytesToEncode((const uchar*)data);



Loading…
Cancel
Save