wmadec: Set data size to 0 if nothing was decoded.
authorAndre Noll <maan@tuebingen.mpg.de>
Thu, 8 Dec 2016 20:32:32 +0000 (21:32 +0100)
committerAndre Noll <maan@tuebingen.mpg.de>
Sun, 11 Dec 2016 12:13:33 +0000 (13:13 +0100)
Without this, we might feed uninitialized data into the output stream.

wmadec_filter.c

index f695d86..41dd51f 100644 (file)
@@ -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);