From 8177e85bf915ddba427024423450c9472cf3a490 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Sat, 9 Apr 2011 15:36:54 +0000 Subject: [PATCH] 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 --- libs/evoral/src/SMF.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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