From b924568f792ea5e5d2841cc413d989738ac00bb8 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 19 Aug 2014 11:57:55 +0200 Subject: decoder/audiofile: check InputStream::KnownSize() The plugin assumes that the size is known, but does not verify it at runtime. --- src/decoder/plugins/AudiofileDecoderPlugin.cxx | 4 ++-- 1 file 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}; -- cgit v1.2.3