aboutsummaryrefslogtreecommitdiff
path: root/src/MusicBuffer.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'src/MusicBuffer.cxx')
-rw-r--r--src/MusicBuffer.cxx6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/MusicBuffer.cxx b/src/MusicBuffer.cxx
index ec6e5205..5fddddc2 100644
--- a/src/MusicBuffer.cxx
+++ b/src/MusicBuffer.cxx
@@ -21,6 +21,7 @@
#include "MusicBuffer.hxx"
#include "MusicChunk.hxx"
#include "util/SliceBuffer.hxx"
+#include "mpd_error.h"
#include <glib.h>
@@ -32,7 +33,10 @@ struct music_buffer : public SliceBuffer<music_chunk> {
music_buffer(unsigned num_chunks)
:SliceBuffer(num_chunks),
- mutex(g_mutex_new()) {}
+ mutex(g_mutex_new()) {
+ if (IsOOM())
+ MPD_ERROR("Failed to allocate buffer");
+ }
~music_buffer() {
g_mutex_free(mutex);