MusicChunk: make the struct size exactly 4096

This commit is contained in:
Max Kellermann 2017-12-30 17:42:43 +01:00
parent de0c3e717e
commit a06bf388d9

View File

@ -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