From f86f31322298aa0a95e590c1eeaa978d3a3ba43a Mon Sep 17 00:00:00 2001 From: Andre Noll Date: Thu, 22 Oct 2009 19:07:55 +0200 Subject: [PATCH] Don't try to init the decoder if less than WMA_FRAME_SKIP bytes are available. --- wmadec_filter.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/wmadec_filter.c b/wmadec_filter.c index 85ba871c..35e2703c 100644 --- a/wmadec_filter.c +++ b/wmadec_filter.c @@ -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) -- 2.39.5