decoder/dsf: add range check

This commit is contained in:
Max Kellermann 2013-10-28 23:41:51 +01:00
parent 0ad2eb34c7
commit 9dcbd005f0
1 changed files with 3 additions and 0 deletions

View File

@ -151,6 +151,9 @@ dsf_read_metadata(Decoder *decoder, InputStream &is,
we use the actual data size as chunk size */
uint64_t data_size = data_chunk.size.Read();
if (data_size < sizeof(data_chunk))
return false;
data_size -= sizeof(data_chunk);
metadata->chunk_size = data_size;