summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Kellermann <max@musicpd.org>2017-12-30 17:42:43 +0100
committerMax Kellermann <max@musicpd.org>2017-12-30 17:50:25 +0100
commita06bf388d968279808009d4538def57e78b4bee7 (patch)
tree8a8acd3060ad21a25a13fe90d6b61beffe538049
parentde0c3e717e82508499ae572cfdf7423a3e36259b (diff)
MusicChunk: make the struct size exactly 4096
-rw-r--r--src/MusicChunk.hxx4
1 files changed, 3 insertions, 1 deletions
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