Commit aa7f5dec authored by Max Kellermann's avatar Max Kellermann

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.
parent 1800bde3
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment