From 66ed2518a2b58601100e0590f449b878a3db15b4 Mon Sep 17 00:00:00 2001 From: Kurt Van Dijck Date: Fri, 1 May 2015 23:33:07 +0200 Subject: [PATCH] mpd_client: fix allocation of outputs --- src/mpd_client.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mpd_client.c b/src/mpd_client.c index c276bee..39e1f5d 100644 --- a/src/mpd_client.c +++ b/src/mpd_client.c @@ -455,7 +455,7 @@ int mpd_put_outputs(char *buffer) idx = mpd_output_get_id(out); if (idx >= soutputs) { /* realloc some more */ - soutputs = (idx + 15) & ~15; /* round up to 16 */ + soutputs = (idx + 1 + 15) & ~15; /* round up to 16 */ outputs = realloc(outputs, sizeof(*outputs)*soutputs); if (!outputs) exit(1); -- 2.20.1