From dbcf22a832609f240abe943f0dcf71fbe5e2665a Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Sun, 23 Mar 2014 02:18:49 +0100 Subject: catch OOM --- libs/ardour/worker.cc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'libs/ardour/worker.cc') 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) { -- cgit v1.2.3