From c6dff555d7ed916d47b5739923613a265042c1a0 Mon Sep 17 00:00:00 2001 From: Andre Noll Date: Thu, 8 Dec 2016 21:32:32 +0100 Subject: [PATCH] wmadec: Set data size to 0 if nothing was decoded. Without this, we might feed uninitialized data into the output stream. --- wmadec_filter.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/wmadec_filter.c b/wmadec_filter.c index f695d869..41dd51f9 100644 --- a/wmadec_filter.c +++ b/wmadec_filter.c @@ -1068,10 +1068,13 @@ static int wma_decode_superframe(struct private_wmadec_data *pwd, void *data, if (buf_size == 0) { pwd->last_superframe_len = 0; + *data_size = 0; return 0; } - if (buf_size < pwd->ahi.block_align) + if (buf_size < pwd->ahi.block_align) { + *data_size = 0; return 0; + } buf_size = pwd->ahi.block_align; samples = data; init_get_bits(&pwd->gb, buf, buf_size); -- 2.39.5