From: Andre Noll Date: Thu, 8 Dec 2016 20:32:32 +0000 (+0100) Subject: wmadec: Set data size to 0 if nothing was decoded. X-Git-Tag: v0.5.7~11^2~2 X-Git-Url: http://git.tue.mpg.de/?a=commitdiff_plain;h=c6dff555d7ed916d47b5739923613a265042c1a0;p=paraslash.git wmadec: Set data size to 0 if nothing was decoded. Without this, we might feed uninitialized data into the output stream. --- 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);