X-Git-Url: http://git.tuebingen.mpg.de/?a=blobdiff_plain;f=wmadec_filter.c;h=d574df35d3a9da3a75f25bf0069f6e887b8b547e;hb=2d58aec6b7de7fdad67518568a79632b1944ee90;hp=70b18b8627c675001c8c85bbb79d7f24a55eff4d;hpb=c23eb9580325d575af15047108b66e7560093203;p=paraslash.git diff --git a/wmadec_filter.c b/wmadec_filter.c index 70b18b86..d574df35 100644 --- a/wmadec_filter.c +++ b/wmadec_filter.c @@ -24,6 +24,7 @@ #include #include #include +#include #include "para.h" #include "error.h" @@ -823,7 +824,7 @@ static int wma_decode_block(struct private_wmadec_data *pwd) /* parse spectral coefficients : just RLE encoding */ for (ch = 0; ch < pwd->ahi.channels; ch++) { struct vlc *coef_vlc; - int level, run, sign, tindex; + int level, run, tindex; int16_t *ptr, *eptr; const uint16_t *level_table, *run_table; @@ -856,8 +857,7 @@ static int wma_decode_block(struct private_wmadec_data *pwd) run = run_table[code]; level = level_table[code]; } - sign = get_bit(&pwd->gb); - if (!sign) + if (!get_bit(&pwd->gb)) level = -level; ptr += run; if (ptr >= eptr) { @@ -1251,6 +1251,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)