From 1178e485cb2a978b8b7e8ba91a2ce6558da7682b Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Thu, 13 Nov 2008 02:06:52 +0100 Subject: music_pipe: check for partial frames in appended chunk Added an additional assertion which checks partial frames in the existing tail chunk. --- src/pipe.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/pipe.c') diff --git a/src/pipe.c b/src/pipe.c index 54d10dd45..c3551265e 100644 --- a/src/pipe.c +++ b/src/pipe.c @@ -190,6 +190,8 @@ tail_chunk(size_t frame_size) chunk = music_pipe_get_chunk(music_pipe.end); assert(chunk->length <= sizeof(chunk->data)); + assert((chunk->length % frame_size) == 0); + if (chunk->length + frame_size > sizeof(chunk->data)) { /* this chunk is full; allocate a new chunk */ next = successor(music_pipe.end); -- cgit v1.2.3