aboutsummaryrefslogtreecommitdiffstats
path: root/src/decoder/plugins/DsfDecoderPlugin.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-08-23 13:26:17 +0200
committerMax Kellermann <max@duempel.org>2014-08-23 13:26:17 +0200
commit8574bcd494ac2a197d98e098c3a5c9cef9186cbf (patch)
tree41bf84ba99d5aca4fa98511c5378c4229e6b5031 /src/decoder/plugins/DsfDecoderPlugin.cxx
parent02cc77cd821a04718a9dfb84134c9520859c3305 (diff)
downloadmpd-8574bcd494ac2a197d98e098c3a5c9cef9186cbf.tar.gz
mpd-8574bcd494ac2a197d98e098c3a5c9cef9186cbf.tar.xz
mpd-8574bcd494ac2a197d98e098c3a5c9cef9186cbf.zip
decoder/dsf: compare with InputStream::GetRest() instead of ..GetSize()
Diffstat (limited to '')
-rw-r--r--src/decoder/plugins/DsfDecoderPlugin.cxx7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/decoder/plugins/DsfDecoderPlugin.cxx b/src/decoder/plugins/DsfDecoderPlugin.cxx
index 953096a45..254cf8d36 100644
--- a/src/decoder/plugins/DsfDecoderPlugin.cxx
+++ b/src/decoder/plugins/DsfDecoderPlugin.cxx
@@ -158,11 +158,8 @@ dsf_read_metadata(Decoder *decoder, InputStream &is,
data_size -= sizeof(data_chunk);
/* data_size cannot be bigger or equal to total file size */
- if (is.KnownSize()) {
- const offset_type size = is.GetSize();
- if (data_size >= size)
- return false;
- }
+ if (is.KnownSize() && data_size > is.GetRest())
+ return false;
/* use the sample count from the DSF header as the upper
bound, because some DSF files contain junk at the end of