diff options
author | Robin Gareus <robin@gareus.org> | 2014-03-23 02:18:49 +0100 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2014-03-23 02:18:49 +0100 |
commit | dbcf22a832609f240abe943f0dcf71fbe5e2665a (patch) | |
tree | f1f59e4e5ff1a7d731b7d16c4600e862a684e4dd /libs/ardour/worker.cc | |
parent | 23f285f126c30a7964a510c12caeff3b7509b04a (diff) |
catch OOM
Diffstat (limited to 'libs/ardour/worker.cc')
-rw-r--r-- | libs/ardour/worker.cc | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/libs/ardour/worker.cc b/libs/ardour/worker.cc index 5b416afa46..aea1c6f8e3 100644 --- a/libs/ardour/worker.cc +++ b/libs/ardour/worker.cc @@ -148,7 +148,13 @@ Worker::run() if (size > buf_size) { buf = realloc(buf, size); - buf_size = size; + if (buf) { + buf_size = size; + } else { + PBD::error << "Worker: Error allocating memory" + << endmsg; + buf_size = 0; // TODO: This is probably fatal + } } if (_requests->read((uint8_t*)buf, size) < size) { |