music_pipe: check for partial frames in appended chunk
Added an additional assertion which checks partial frames in the existing tail chunk.
This commit is contained in:
parent
df09075afc
commit
1178e485cb
@ -190,6 +190,8 @@ tail_chunk(size_t frame_size)
|
|||||||
|
|
||||||
chunk = music_pipe_get_chunk(music_pipe.end);
|
chunk = music_pipe_get_chunk(music_pipe.end);
|
||||||
assert(chunk->length <= sizeof(chunk->data));
|
assert(chunk->length <= sizeof(chunk->data));
|
||||||
|
assert((chunk->length % frame_size) == 0);
|
||||||
|
|
||||||
if (chunk->length + frame_size > sizeof(chunk->data)) {
|
if (chunk->length + frame_size > sizeof(chunk->data)) {
|
||||||
/* this chunk is full; allocate a new chunk */
|
/* this chunk is full; allocate a new chunk */
|
||||||
next = successor(music_pipe.end);
|
next = successor(music_pipe.end);
|
||||||
|
Loading…
Reference in New Issue
Block a user