From a06bf388d968279808009d4538def57e78b4bee7 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sat, 30 Dec 2017 17:42:43 +0100 Subject: MusicChunk: make the struct size exactly 4096 --- src/MusicChunk.hxx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/MusicChunk.hxx b/src/MusicChunk.hxx index 4a12931a5..532edf589 100644 --- a/src/MusicChunk.hxx +++ b/src/MusicChunk.hxx @@ -124,7 +124,7 @@ struct MusicChunkInfo { */ struct MusicChunk : MusicChunkInfo { /** the data (probably PCM) */ - uint8_t data[CHUNK_SIZE]; + uint8_t data[CHUNK_SIZE - sizeof(MusicChunkInfo)]; /** * Prepares appending to the music chunk. Returns a buffer @@ -153,4 +153,6 @@ struct MusicChunk : MusicChunkInfo { bool Expand(AudioFormat af, size_t length) noexcept; }; +static_assert(sizeof(MusicChunk) == CHUNK_SIZE, "Wrong size"); + #endif -- cgit v1.2.3