pcm/Order: fix size calculation with 8 channels

This was a buffer overflow bug which could cause MPD crahes when
playing back 8 channels with the ALSA output plugin.

Closes #216
This commit is contained in:
Max Kellermann
2018-02-09 19:01:12 +01:00
parent c801936e53
commit 6de92bb42b
2 changed files with 3 additions and 1 deletions

View File

@@ -88,7 +88,7 @@ static inline ConstBuffer<V>
ToAlsaChannelOrder71(PcmBuffer &buffer, ConstBuffer<V> src)
{
auto dest = buffer.GetT<V>(src.size);
ToAlsaChannelOrder71(dest, src.data, src.size / 6);
ToAlsaChannelOrder71(dest, src.data, src.size / 8);
return { dest, src.size };
}