Skip to content
Snippets Groups Projects
Commit 599eac4e authored by Volker Rümelin's avatar Volker Rümelin Committed by Gerd Hoffmann
Browse files

audio: audio_generic_get_buffer_in should honor *size

The function generic_get_buffer_in currently ignores the *size
parameter and may return a buffer larger than *size.

As a result the variable samples in function
audio_pcm_hw_run_in may underflow. The while loop then most
likely will never termiate.

Buglink: http://bugs.debian.org/948658


Signed-off-by: default avatarVolker Rümelin <vr_qemu@t-online.de>
Message-Id: <20200123074943.6699-9-vr_qemu@t-online.de>
Signed-off-by: default avatarGerd Hoffmann <kraxel@redhat.com>
parent f03cd068
No related branches found
No related tags found
No related merge requests found
......@@ -1407,7 +1407,8 @@ void *audio_generic_get_buffer_in(HWVoiceIn *hw, size_t *size)
}
assert(start >= 0 && start < hw->size_emul);
*size = MIN(hw->pending_emul, hw->size_emul - start);
*size = MIN(*size, hw->pending_emul);
*size = MIN(*size, hw->size_emul - start);
return hw->buf_emul + start;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment