Don't try to init the decoder if less than WMA_FRAME_SKIP bytes are available.
authorAndre Noll <maan@systemlinux.org>
Thu, 22 Oct 2009 17:07:55 +0000 (19:07 +0200)
committerAndre Noll <maan@systemlinux.org>
Wed, 18 Nov 2009 18:34:27 +0000 (19:34 +0100)
wmadec_filter.c

index 85ba871..35e2703 100644 (file)
@@ -178,7 +178,6 @@ static void init_coef_vlc(struct vlc *vlc, uint16_t **prun_table,
        uint16_t *run_table, *level_table;
        int i, l, j, k, level;
 
-       PARA_ERROR_LOG("n: %d\n", n);
        init_vlc(vlc, VLCBITS, n, table_bits, table_codes, 4);
 
        run_table = para_malloc(n * sizeof(uint16_t));
@@ -1251,6 +1250,8 @@ static ssize_t wmadec_convert(char *inbuffer, size_t len,
 
        if (out_size < 128 * 1024)
                return 0;
+       if (len <= WMA_FRAME_SKIP)
+               return 0;
        if (!pwd) {
                ret = wma_decode_init(inbuffer, len, &pwd);
                if (ret <= 0)