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.
This commit is contained in:
Max Kellermann 2020-03-12 20:29:15 +01:00
parent 01632d37ef
commit d942f874ae
1 changed files with 1 additions and 1 deletions

View File

@ -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;
}