summaryrefslogtreecommitdiff
path: root/libs/evoral/src/SMF.cpp
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2011-04-09 15:36:54 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2011-04-09 15:36:54 +0000
commit8177e85bf915ddba427024423450c9472cf3a490 (patch)
tree85b9bc24c556c24baa5ebf0c1d0beecff53a7c84 /libs/evoral/src/SMF.cpp
parent93a24066dee65230769be7f6ac55ecf87d490acf (diff)
fix mismatching use of operator new() when allocating buffer to passed into libsmf - should be malloc'ed
git-svn-id: svn://localhost/ardour2/branches/3.0@9339 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/evoral/src/SMF.cpp')
-rw-r--r--libs/evoral/src/SMF.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/libs/evoral/src/SMF.cpp b/libs/evoral/src/SMF.cpp
index 1b6b427859..a9b7172692 100644
--- a/libs/evoral/src/SMF.cpp
+++ b/libs/evoral/src/SMF.cpp
@@ -311,7 +311,10 @@ SMF::append_event_delta(uint32_t delta_t, uint32_t size, const uint8_t* buf, eve
lenlen = smf_format_vlq (lenbuf, sizeof(lenbuf), idlen+2);
event->midi_buffer_length = 2 + lenlen + 2 + idlen;
- event->midi_buffer = new uint8_t[event->midi_buffer_length];
+ /* this should be allocated by malloc(3) because libsmf will
+ call free(3) on it
+ */
+ event->midi_buffer = (uint8_t*) malloc (sizeof (uint8_t*) * event->midi_buffer_length);
event->midi_buffer[0] = 0xff; // Meta-event
event->midi_buffer[1] = 0x7f; // Sequencer-specific