diff options
author | Max Kellermann <max@duempel.org> | 2008-11-13 02:06:52 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2008-11-13 02:06:52 +0100 |
commit | 1178e485cb2a978b8b7e8ba91a2ce6558da7682b (patch) | |
tree | 02ddccae275d1766904b0790d82a3196535a975f /src | |
parent | df09075afc13c1302facaa46b12df5251861e117 (diff) | |
download | mpd-1178e485cb2a978b8b7e8ba91a2ce6558da7682b.tar.gz mpd-1178e485cb2a978b8b7e8ba91a2ce6558da7682b.tar.xz mpd-1178e485cb2a978b8b7e8ba91a2ce6558da7682b.zip |
music_pipe: check for partial frames in appended chunk
Added an additional assertion which checks partial frames in the
existing tail chunk.
Diffstat (limited to 'src')
-rw-r--r-- | src/pipe.c | 2 |
1 files changed, 2 insertions, 0 deletions
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); |