From: Kurt Van Dijck Date: Fri, 1 May 2015 21:33:07 +0000 (+0200) Subject: mpd_client: fix allocation of outputs X-Git-Url: http://gitweb.hugovil.com/?a=commitdiff_plain;h=66ed2518a2b58601100e0590f449b878a3db15b4;p=ympd.git mpd_client: fix allocation of outputs --- 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);