mirror of
https://github.com/SuperBFG7/ympd
synced 2024-11-26 14:57:17 +00:00
mpd_client: fix allocation of outputs
This commit is contained in:
parent
d344ec05a9
commit
66ed2518a2
@ -455,7 +455,7 @@ int mpd_put_outputs(char *buffer)
|
|||||||
idx = mpd_output_get_id(out);
|
idx = mpd_output_get_id(out);
|
||||||
if (idx >= soutputs) {
|
if (idx >= soutputs) {
|
||||||
/* realloc some more */
|
/* 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);
|
outputs = realloc(outputs, sizeof(*outputs)*soutputs);
|
||||||
if (!outputs)
|
if (!outputs)
|
||||||
exit(1);
|
exit(1);
|
||||||
|
Loading…
Reference in New Issue
Block a user