From d8ef153729dfe72d84cdc3a4717a418d4883bb47 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Mon, 11 May 2009 17:25:34 +0200 Subject: music_chunk: added more audio_format_valid() assertions Check the validity of the audio_format during write operations. --- src/chunk.c | 2 ++ 1 file changed, 2 insertions(+) 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 -- cgit v1.2.3