decoder/audiofile: check InputStream::KnownSize()
The plugin assumes that the size is known, but does not verify it at runtime.
This commit is contained in:
parent
e6e9c21275
commit
b924568f79
@ -184,7 +184,7 @@ audiofile_setup_sample_format(AFfilehandle af_fp)
|
|||||||
static void
|
static void
|
||||||
audiofile_stream_decode(Decoder &decoder, InputStream &is)
|
audiofile_stream_decode(Decoder &decoder, InputStream &is)
|
||||||
{
|
{
|
||||||
if (!is.IsSeekable()) {
|
if (!is.IsSeekable() || !is.KnownSize()) {
|
||||||
LogWarning(audiofile_domain, "not seekable");
|
LogWarning(audiofile_domain, "not seekable");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -250,7 +250,7 @@ gcc_pure
|
|||||||
static int
|
static int
|
||||||
audiofile_get_duration(InputStream &is)
|
audiofile_get_duration(InputStream &is)
|
||||||
{
|
{
|
||||||
if (!is.IsSeekable())
|
if (!is.IsSeekable() || !is.KnownSize())
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
AudioFileInputStream afis{nullptr, is};
|
AudioFileInputStream afis{nullptr, is};
|
||||||
|
Loading…
Reference in New Issue
Block a user