More misc wma fixes.
[paraslash.git] / wmadec_filter.c
index a548d04894040bb79b9d8247ad40200b58d917da..4d384e1ddf9c82c2768712f9a50aaf44af5284f9 100644 (file)
@@ -446,14 +446,13 @@ static int wma_decode_init(char *initial_buf, int len, struct private_wmadec_dat
        struct private_wmadec_data *s;
        int ret, i;
 
-       if (len < 18)
-               return 0;
-
        PARA_NOTICE_LOG("initial buf: %d bytes\n", len);
        s = para_calloc(sizeof(*s));
        ret = read_asf_header(initial_buf, len, &s->ahi);
-       if (ret < 0)
+       if (ret <= 0) {
+               free(s);
                return ret;
+       }
 
        s->use_exp_vlc = s->ahi.flags2 & 0x0001;
        s->use_bit_reservoir = s->ahi.flags2 & 0x0002;