From 34c18d0de34430c1c53b69f06d54440cf3a25d93 Mon Sep 17 00:00:00 2001 From: XANTRONIX Development Date: Thu, 3 Feb 2022 18:02:40 -0500 Subject: Ensure stream reads can't oversohot buffer size --- src/audio.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/audio.c b/src/audio.c index f5dc5ee..001d449 100644 --- a/src/audio.c +++ b/src/audio.c @@ -178,6 +178,10 @@ ssize_t xas_audio_stream_read(xas_audio_stream *stream, size_t count) { *samples = stream + 1; + if (count > stream->buffer_size) { + count = stream->buffer_size; + } + return stream->fill(stream->ctx, *samples, count, -- cgit v1.2.3