diff options
author | David Robillard <d@drobilla.net> | 2013-01-19 07:00:43 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2013-01-19 07:00:43 +0000 |
commit | fc77ae0738565770abde1a25f650a035cf082af0 (patch) | |
tree | f4edb7bcdcddf186fcf5cf4fb033e602580e4008 /libs/evoral/evoral | |
parent | d251c68d7676a18ab9ed935e22558e2b18981b41 (diff) |
Replace a bunch of potential crashes with graceful handling of the situation.
We really need some kind of more sophisticated assert macro that can be
switched to non-fatal logging mode for release builds. A log message, which is
often all that would happen, is a lot better than a trainwrecked performance...
git-svn-id: svn://localhost/ardour2/branches/3.0@13892 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/evoral/evoral')
-rw-r--r-- | libs/evoral/evoral/EventRingBuffer.hpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libs/evoral/evoral/EventRingBuffer.hpp b/libs/evoral/evoral/EventRingBuffer.hpp index 8fec622243..419f427f33 100644 --- a/libs/evoral/evoral/EventRingBuffer.hpp +++ b/libs/evoral/evoral/EventRingBuffer.hpp @@ -116,7 +116,7 @@ template<typename Time> inline uint32_t EventRingBuffer<Time>::write(Time time, EventType type, uint32_t size, const uint8_t* buf) { - if (write_space() < (sizeof(Time) + sizeof(EventType) + sizeof(uint32_t) + size)) { + if (!buf || write_space() < (sizeof(Time) + sizeof(EventType) + sizeof(uint32_t) + size)) { return 0; } else { PBD::RingBufferNPT<uint8_t>::write ((uint8_t*)&time, sizeof(Time)); |