From 9dcbd005f0087c5644d86db4eb1b24cc0c39d132 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Mon, 28 Oct 2013 23:41:51 +0100 Subject: decoder/dsf: add range check --- src/decoder/DsfDecoderPlugin.cxx | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/decoder') diff --git a/src/decoder/DsfDecoderPlugin.cxx b/src/decoder/DsfDecoderPlugin.cxx index a9eaebcbc..a7e2f3d1e 100644 --- a/src/decoder/DsfDecoderPlugin.cxx +++ b/src/decoder/DsfDecoderPlugin.cxx @@ -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; -- cgit v1.2.3