audio/ossaudio: fix off-by-one in mmap buffer size assertion

oss_put_buffer_out() asserts size < hw->size_emul, but a write that
fills the entire buffer (size == size_emul) is valid. Use <= instead.

Reported-by: Hui Peng <benquike@gmail.com>
Fixes: 3ba4066d08 ("ossaudio: port to the new audio backend api")
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-ID: <20261004-issue-4560-v1-3-ccbef537cbeb@redhat.com>
This commit is contained in:
Marc-André Lureau committed 2026-10-13 17:22:49 +04:00
1 parent c3d3fad789
commit 9c6c5b4812
1 file changed
+1 -1
+1 -1
View File
@@ -393,7 +393,7 @@ static size_t oss_put_buffer_out(HWVoiceOut *hw, void *buf, size_t size)
{
OSSVoiceOut *oss = (OSSVoiceOut *) hw;
if (oss->mmapped) {
assert(buf == hw->buf_emul + hw->pos_emul && size < hw->size_emul);
assert(buf == hw->buf_emul + hw->pos_emul && size <= hw->size_emul);
hw->pos_emul = (hw->pos_emul + size) % hw->size_emul;
return size;