aboutsummaryrefslogtreecommitdiffstats
path: root/src/decoder/plugins/AudiofileDecoderPlugin.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-08-19 11:57:55 +0200
committerMax Kellermann <max@duempel.org>2014-08-19 11:58:15 +0200
commitb924568f792ea5e5d2841cc413d989738ac00bb8 (patch)
treee02883cb7a81a7c36612c8dd01eac9ce18693735 /src/decoder/plugins/AudiofileDecoderPlugin.cxx
parente6e9c21275e2c2cf8be2f46f801bfc0de8f24718 (diff)
downloadmpd-b924568f792ea5e5d2841cc413d989738ac00bb8.tar.gz
mpd-b924568f792ea5e5d2841cc413d989738ac00bb8.tar.xz
mpd-b924568f792ea5e5d2841cc413d989738ac00bb8.zip
decoder/audiofile: check InputStream::KnownSize()
The plugin assumes that the size is known, but does not verify it at runtime.
Diffstat (limited to 'src/decoder/plugins/AudiofileDecoderPlugin.cxx')
-rw-r--r--src/decoder/plugins/AudiofileDecoderPlugin.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/decoder/plugins/AudiofileDecoderPlugin.cxx b/src/decoder/plugins/AudiofileDecoderPlugin.cxx
index 93a6e03a2..5accff034 100644
--- a/src/decoder/plugins/AudiofileDecoderPlugin.cxx
+++ b/src/decoder/plugins/AudiofileDecoderPlugin.cxx
@@ -184,7 +184,7 @@ audiofile_setup_sample_format(AFfilehandle af_fp)
static void
audiofile_stream_decode(Decoder &decoder, InputStream &is)
{
- if (!is.IsSeekable()) {
+ if (!is.IsSeekable() || !is.KnownSize()) {
LogWarning(audiofile_domain, "not seekable");
return;
}
@@ -250,7 +250,7 @@ gcc_pure
static int
audiofile_get_duration(InputStream &is)
{
- if (!is.IsSeekable())
+ if (!is.IsSeekable() || !is.KnownSize())
return -1;
AudioFileInputStream afis{nullptr, is};