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:
parent
01632d37ef
commit
d942f874ae
|
@ -71,7 +71,7 @@ public:
|
||||||
bool seekable, SignedSongTime duration) noexcept override;
|
bool seekable, SignedSongTime duration) noexcept override;
|
||||||
|
|
||||||
DecoderCommand GetCommand() noexcept override {
|
DecoderCommand GetCommand() noexcept override {
|
||||||
return !error && remaining_bytes > 0
|
return !error && (!ready || remaining_bytes > 0)
|
||||||
? DecoderCommand::NONE
|
? DecoderCommand::NONE
|
||||||
: DecoderCommand::STOP;
|
: DecoderCommand::STOP;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue