aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2009-05-11 17:25:34 +0200
committerMax Kellermann <max@duempel.org>2009-05-11 17:25:34 +0200
commitd8ef153729dfe72d84cdc3a4717a418d4883bb47 (patch)
treec849a3b65831c26ae1f456425d59a5719e86b168
parent1a9a65b23b2762344c0cbb3b50d5a52a6bb12d39 (diff)
downloadmpd-d8ef153729dfe72d84cdc3a4717a418d4883bb47.tar.gz
mpd-d8ef153729dfe72d84cdc3a4717a418d4883bb47.tar.xz
mpd-d8ef153729dfe72d84cdc3a4717a418d4883bb47.zip
music_chunk: added more audio_format_valid() assertions
Check the validity of the audio_format during write operations.
Diffstat (limited to '')
-rw-r--r--src/chunk.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/chunk.c b/src/chunk.c
index a0925fa72..3ac190633 100644
--- a/src/chunk.c
+++ b/src/chunk.c
@@ -44,6 +44,7 @@ music_chunk_check_format(const struct music_chunk *chunk,
{
assert(chunk != NULL);
assert(audio_format != NULL);
+ assert(audio_format_valid(audio_format));
return chunk->length == 0 ||
audio_format_equals(&chunk->audio_format, audio_format);
@@ -60,6 +61,7 @@ music_chunk_write(struct music_chunk *chunk,
size_t num_frames;
assert(music_chunk_check_format(chunk, audio_format));
+ assert(chunk->length == 0 || audio_format_valid(&chunk->audio_format));
if (chunk->length == 0) {
/* if the chunk is empty, nobody has set bitRate and