aboutsummaryrefslogtreecommitdiffstats
path: root/src/input/AsyncInputStream.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-11-07 13:55:23 +0100
committerMax Kellermann <max@duempel.org>2014-11-07 13:57:57 +0100
commit1bd8a322f52c3094b8d343f249f54b75a97bd598 (patch)
tree38a11adb3d507a4954e952bdfbd8b837910709e4 /src/input/AsyncInputStream.cxx
parent362e73bea88c8bf4a59e16939da615bf5ddf0558 (diff)
downloadmpd-1bd8a322f52c3094b8d343f249f54b75a97bd598.tar.gz
mpd-1bd8a322f52c3094b8d343f249f54b75a97bd598.tar.xz
mpd-1bd8a322f52c3094b8d343f249f54b75a97bd598.zip
input/AsyncInputStream: set Error when seeking unseekable
Fixes crash in the "audiofile" decoder while logging the seek error.
Diffstat (limited to 'src/input/AsyncInputStream.cxx')
-rw-r--r--src/input/AsyncInputStream.cxx5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/input/AsyncInputStream.cxx b/src/input/AsyncInputStream.cxx
index d34ba2ff3..c8e3fcfd5 100644
--- a/src/input/AsyncInputStream.cxx
+++ b/src/input/AsyncInputStream.cxx
@@ -19,6 +19,7 @@
#include "config.h"
#include "AsyncInputStream.hxx"
+#include "Domain.hxx"
#include "tag/Tag.hxx"
#include "event/Call.hxx"
#include "thread/Cond.hxx"
@@ -113,8 +114,10 @@ AsyncInputStream::Seek(offset_type new_offset, Error &error)
/* no-op */
return true;
- if (!IsSeekable())
+ if (!IsSeekable()) {
+ error.Set(input_domain, "Not seekable");
return false;
+ }
/* check if we can fast-forward the buffer */