Commit 7b7fb5ac authored by Max Kellermann's avatar Max Kellermann

decoder/pcm: fix potential assertion failure in FillBuffer()

After a seek failure, the buffer may still be full, and then FillBuffer() aborts with assertion failure.
parent 0a7d612f
......@@ -43,7 +43,8 @@ FillBuffer(DecoderClient &client, InputStream &is, B &buffer)
{
buffer.Shift();
auto w = buffer.Write();
assert(!w.IsEmpty());
if (w.IsEmpty())
return true;
size_t nbytes = decoder_read(client, is, w.data, w.size);
if (nbytes == 0 && is.LockIsEOF())
......
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