diff options
author | XANTRONIX Development | 2022-02-03 18:02:40 -0500 |
---|---|---|
committer | XANTRONIX Development | 2022-02-03 18:02:40 -0500 |
commit | 34c18d0de34430c1c53b69f06d54440cf3a25d93 (patch) | |
tree | 64ec20907d8f12c0b5f2a7d52388ccc8f122e246 | |
parent | 46ee5553721505ae172faa357daed79c54df1387 (diff) | |
download | xas-34c18d0de34430c1c53b69f06d54440cf3a25d93.tar.gz xas-34c18d0de34430c1c53b69f06d54440cf3a25d93.tar.bz2 xas-34c18d0de34430c1c53b69f06d54440cf3a25d93.zip |
Ensure stream reads can't oversohot buffer size
-rw-r--r-- | src/audio.c | 4 |
1 files changed, 4 insertions, 0 deletions
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, |