Commit d942f874 authored by Max Kellermann's avatar Max Kellermann

lib/chromaprint/DecoderClient: check `ready` in GetCommand()

Fixes access to uninitialized memory (`remaining_bytes` isn't initialized until Ready() is called) and fixes spurious `getfingerprint` failures.
parent 01632d37
......@@ -71,7 +71,7 @@ public:
bool seekable, SignedSongTime duration) noexcept override;
DecoderCommand GetCommand() noexcept override {
return !error && remaining_bytes > 0
return !error && (!ready || remaining_bytes > 0)
? DecoderCommand::NONE
: DecoderCommand::STOP;
}
......
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