Browse Source

Always initialize LV2 atom output buffer

pull/20/merge
falkTX 8 years ago
parent
commit
200b58cc6d
1 changed files with 5 additions and 10 deletions
  1. +5
    -10
      distrho/src/DistrhoPluginLV2.cpp

+ 5
- 10
distrho/src/DistrhoPluginLV2.cpp View File

@@ -589,10 +589,14 @@ public:
#if DISTRHO_PLUGIN_WANT_STATE && DISTRHO_PLUGIN_HAS_UI
const uint32_t capacity = fPortEventsOut->atom.size;

bool needsInit = true;
uint32_t size, offset = 0;
LV2_Atom_Event* aev;

fPortEventsOut->atom.size = 0;
fPortEventsOut->atom.type = fURIDs.atomSequence;
fPortEventsOut->body.unit = 0;
fPortEventsOut->body.pad = 0;

// TODO - MIDI Output

for (uint32_t i=0, count=fPlugin.getStateCount(); i < count; ++i)
@@ -617,15 +621,6 @@ public:
if (sizeof(LV2_Atom_Event) + msgSize > capacity - offset)
break;

if (needsInit)
{
fPortEventsOut->atom.size = 0;
fPortEventsOut->atom.type = fURIDs.atomSequence;
fPortEventsOut->body.unit = 0;
fPortEventsOut->body.pad = 0;
needsInit = false;
}

// reserve msg space
char msgBuf[msgSize];
std::memset(msgBuf, 0, msgSize);


Loading…
Cancel
Save