diff options
author | Max Kellermann <max@duempel.org> | 2014-08-19 20:12:10 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2014-08-19 20:24:09 +0200 |
commit | 1307633a844a6be410b2a8ae1f90951a78b55728 (patch) | |
tree | 9a3eb5d29b3eed7397802127ad84a28507434fde | |
parent | 1a53f07d8084453d66f9c0b7bd940a1790ef7c10 (diff) | |
download | mpd-1307633a844a6be410b2a8ae1f90951a78b55728.tar.gz mpd-1307633a844a6be410b2a8ae1f90951a78b55728.tar.xz mpd-1307633a844a6be410b2a8ae1f90951a78b55728.zip |
decoder/dsf: check InputStream::KnownSize()
Diffstat (limited to '')
-rw-r--r-- | src/decoder/plugins/DsfDecoderPlugin.cxx | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/decoder/plugins/DsfDecoderPlugin.cxx b/src/decoder/plugins/DsfDecoderPlugin.cxx index a48a8f321..b510352ee 100644 --- a/src/decoder/plugins/DsfDecoderPlugin.cxx +++ b/src/decoder/plugins/DsfDecoderPlugin.cxx @@ -155,9 +155,11 @@ dsf_read_metadata(Decoder *decoder, InputStream &is, data_size -= sizeof(data_chunk); /* data_size cannot be bigger or equal to total file size */ - const uint64_t size = (uint64_t)is.GetSize(); - if (data_size >= size) - return false; + if (is.KnownSize()) { + const uint64_t size = (uint64_t)is.GetSize(); + if (data_size >= size) + return false; + } /* use the sample count from the DSF header as the upper bound, because some DSF files contain junk at the end of |