From 7b4305d81bf29f89c232a0aba4d61817912430d8 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sat, 10 Dec 2016 00:11:29 +0100 Subject: [PATCH] decoder/wavpack: seek errors are fatal The libWavPack documentation says: "After a FALSE return the file should not be accessed again (other than to close it); this is a fatal error." --- src/decoder/plugins/WavpackDecoderPlugin.cxx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/decoder/plugins/WavpackDecoderPlugin.cxx b/src/decoder/plugins/WavpackDecoderPlugin.cxx index cdbda6e1e..138556ea9 100644 --- a/src/decoder/plugins/WavpackDecoderPlugin.cxx +++ b/src/decoder/plugins/WavpackDecoderPlugin.cxx @@ -217,12 +217,13 @@ wavpack_decode(DecoderClient &client, WavpackContext *wpc, bool can_seek) if (cmd == DecoderCommand::SEEK) { if (can_seek) { auto where = client.GetSeekFrame(); - - if (WavpackSeekSample(wpc, where)) { - client.CommandFinished(); - } else { + if (!WavpackSeekSample(wpc, where)) { + /* seek errors are fatal */ client.SeekError(); + break; } + + client.CommandFinished(); } else { client.SeekError(); }