Browse Source

Print warning if LV2 UI tries to send bad data

tags/v1.9.11
falkTX 6 years ago
parent
commit
2038a91cde
2 changed files with 10 additions and 2 deletions
  1. +5
    -1
      source/backend/plugin/CarlaPluginLV2.cpp
  2. +5
    -1
      source/bridges-ui/CarlaBridgeFormatLV2.cpp

+ 5
- 1
source/backend/plugin/CarlaPluginLV2.cpp View File

@@ -4772,7 +4772,11 @@ public:
const LV2_Atom* const atom((const LV2_Atom*)buffer); const LV2_Atom* const atom((const LV2_Atom*)buffer);


// plugins sometimes fail on this, not good... // plugins sometimes fail on this, not good...
CARLA_SAFE_ASSERT_INT2(bufferSize == lv2_atom_total_size(atom), bufferSize, atom->size);
const uint32_t totalSize = lv2_atom_total_size(atom);
const uint32_t paddedSize = lv2_atom_pad_size(totalSize);

if (bufferSize != totalSize && bufferSize != paddedSize)
carla_stderr2("Warning: LV2 UI sending atom with invalid size! size: %u, padded-size: %u", totalSize, paddedSize);


for (uint32_t i=0; i < fEventsIn.count; ++i) for (uint32_t i=0; i < fEventsIn.count; ++i)
{ {


+ 5
- 1
source/bridges-ui/CarlaBridgeFormatLV2.cpp View File

@@ -713,7 +713,11 @@ public:
const LV2_Atom* const atom((const LV2_Atom*)buffer); const LV2_Atom* const atom((const LV2_Atom*)buffer);


// plugins sometimes fail on this, not good... // plugins sometimes fail on this, not good...
CARLA_SAFE_ASSERT_INT2(bufferSize == lv2_atom_total_size(atom), bufferSize, atom->size);
const uint32_t totalSize = lv2_atom_total_size(atom);
const uint32_t paddedSize = lv2_atom_pad_size(totalSize);

if (bufferSize != totalSize && bufferSize != paddedSize)
carla_stderr2("Warning: LV2 UI sending atom with invalid size! size: %u, padded-size: %u", totalSize, paddedSize);


writeLv2AtomMessage(rindex, atom); writeLv2AtomMessage(rindex, atom);
} }


Loading…
Cancel
Save