From 7b7fb5acd5ec6f0c0fce625837e1507139dc1cc6 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Mon, 24 Apr 2017 11:20:37 +0200 Subject: [PATCH] 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. --- src/decoder/plugins/PcmDecoderPlugin.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/decoder/plugins/PcmDecoderPlugin.cxx b/src/decoder/plugins/PcmDecoderPlugin.cxx index 6382e8c07..a74db186b 100644 --- a/src/decoder/plugins/PcmDecoderPlugin.cxx +++ b/src/decoder/plugins/PcmDecoderPlugin.cxx @@ -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())