decoder/dsf: add range check

This commit is contained in:
Max Kellermann 2013-10-28 23:41:51 +01:00
parent 0ad2eb34c7
commit 9dcbd005f0

View File

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