aboutsummaryrefslogtreecommitdiffstats
path: root/src/decoder
diff options
context:
space:
mode:
Diffstat (limited to 'src/decoder')
-rw-r--r--src/decoder/DsfDecoderPlugin.cxx3
1 files changed, 3 insertions, 0 deletions
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;