diff options
author | Max Kellermann <max@duempel.org> | 2009-06-02 08:37:30 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2009-06-02 08:40:28 +0200 |
commit | aa7f5dec87e5decd2905056938e0af0e35aa0130 (patch) | |
tree | 8007361730a17df8ac72886c8be02b12b90a459d /src/player_thread.c | |
parent | 1800bde3038f6af07d4b9383f30580c3da95c210 (diff) | |
download | mpd-aa7f5dec87e5decd2905056938e0af0e35aa0130.tar.gz mpd-aa7f5dec87e5decd2905056938e0af0e35aa0130.tar.xz mpd-aa7f5dec87e5decd2905056938e0af0e35aa0130.zip |
player_thread: don't leak empty music_chunks
When a music_chunk only contains a tag but no PCM data, play_chunk()
returns true without freeing the chunk. The caller now assumes that
the chunk is moved into some music_pipe and does not bother to free it
either.
Diffstat (limited to '')
-rw-r--r-- | src/player_thread.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/player_thread.c b/src/player_thread.c index f00d1aba8..add093083 100644 --- a/src/player_thread.c +++ b/src/player_thread.c @@ -447,8 +447,10 @@ play_chunk(struct song *song, struct music_chunk *chunk, } } - if (chunk->length == 0) + if (chunk->length == 0) { + music_buffer_return(player_buffer, chunk); return true; + } pc.elapsed_time = chunk->times; pc.bit_rate = chunk->bit_rate; |