mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-23 23:17:46 +01:00
VST3: handle zero length plugin state
This commit is contained in:
parent
5e882afe10
commit
8209b4b948
1 changed files with 2 additions and 2 deletions
|
|
@ -474,7 +474,7 @@ RAMStream::RAMStream (uint8_t* data, size_t size)
|
||||||
, _pos (0)
|
, _pos (0)
|
||||||
, _readonly (true)
|
, _readonly (true)
|
||||||
{
|
{
|
||||||
if (reallocate_buffer (_size, true)) {
|
if (size > 0 && reallocate_buffer (_size, true)) {
|
||||||
memcpy (_data, data, _size);
|
memcpy (_data, data, _size);
|
||||||
} else {
|
} else {
|
||||||
_size = 0;
|
_size = 0;
|
||||||
|
|
@ -494,7 +494,7 @@ RAMStream::RAMStream (std::string const& fn)
|
||||||
if (!g_file_get_contents (fn.c_str (), &buf, &length, NULL)) {
|
if (!g_file_get_contents (fn.c_str (), &buf, &length, NULL)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (reallocate_buffer (length, true)) {
|
if (length > 0 && reallocate_buffer (length, true)) {
|
||||||
_size = length;
|
_size = length;
|
||||||
memcpy (_data, buf, _size);
|
memcpy (_data, buf, _size);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue