Browse Source

Fix wrong assertion with size 1 MIDI messages in carla-patchbay

Closes #1099

Signed-off-by: falkTX <falktx@falktx.com>
tags/v2.2.0-RC1
falkTX 4 years ago
parent
commit
890a5badbb
Signed by: falkTX <falktx@falktx.com> GPG Key ID: CDBAA37ABC74FBA0
1 changed files with 6 additions and 3 deletions
  1. +6
    -3
      source/utils/CarlaEngineUtils.hpp

+ 6
- 3
source/utils/CarlaEngineUtils.hpp View File

@@ -1,6 +1,6 @@
/*
* Carla Engine utils
* Copyright (C) 2011-2018 Filipe Coelho <falktx@falktx.com>
* Copyright (C) 2011-2020 Filipe Coelho <falktx@falktx.com>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
@@ -192,8 +192,11 @@ void fillWaterMidiBufferFromEngineEvents(water::MidiBuffer& midiBuffer, const En
// set first byte
mdataTmp[0] = static_cast<uint8_t>(midiEvent.data[0] | (engineEvent.channel & MIDI_CHANNEL_BIT));

// copy rest
carla_copy<uint8_t>(mdataTmp+1, midiEvent.data+1, size-1U);
if (size > 1)
{
// copy rest
carla_copy<uint8_t>(mdataTmp+1, midiEvent.data+1, size-1U);
}

// done
mdataPtr = mdataTmp;


Loading…
Cancel
Save