mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-08 23:24:19 +00:00
MemoryOutputStream: Avoid integer overflow which may result in incorrect size after expansion
This commit is contained in:
parent
65e9bf1c52
commit
540830506b
1 changed files with 1 additions and 1 deletions
|
|
@ -93,7 +93,7 @@ char* MemoryOutputStream::prepareToWrite (size_t numBytes)
|
|||
if (blockToUse != nullptr)
|
||||
{
|
||||
if (storageNeeded >= blockToUse->getSize())
|
||||
blockToUse->ensureSize ((storageNeeded + jmin (storageNeeded / 2, (size_t) (1024 * 1024)) + 32) & ~31u);
|
||||
blockToUse->ensureSize ((storageNeeded + jmin (storageNeeded / 2, (size_t) (1024 * 1024)) + 32) & ~(size_t) 31);
|
||||
|
||||
data = static_cast<char*> (blockToUse->getData());
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue