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.
This commit is contained in:
Max Kellermann 2017-04-24 11:20:37 +02:00
parent 0a7d612f41
commit 7b7fb5acd5

View File

@ -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())