Commit 1307633a authored by Max Kellermann's avatar Max Kellermann

decoder/dsf: check InputStream::KnownSize()

parent 1a53f07d
...@@ -155,9 +155,11 @@ dsf_read_metadata(Decoder *decoder, InputStream &is, ...@@ -155,9 +155,11 @@ dsf_read_metadata(Decoder *decoder, InputStream &is,
data_size -= sizeof(data_chunk); data_size -= sizeof(data_chunk);
/* data_size cannot be bigger or equal to total file size */ /* data_size cannot be bigger or equal to total file size */
const uint64_t size = (uint64_t)is.GetSize(); if (is.KnownSize()) {
if (data_size >= size) const uint64_t size = (uint64_t)is.GetSize();
return false; if (data_size >= size)
return false;
}
/* use the sample count from the DSF header as the upper /* use the sample count from the DSF header as the upper
bound, because some DSF files contain junk at the end of bound, because some DSF files contain junk at the end of
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment