X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=wmadec_filter.c;h=0e2f6b8515773ac6c5c8ebb71fed620e7f25692e;hp=a548d04894040bb79b9d8247ad40200b58d917da;hb=38a5117b3b132ac87e424689cfa7e4d81dd5b071;hpb=f481eaddec671c3783cc098d65be29ea16ee81b1 diff --git a/wmadec_filter.c b/wmadec_filter.c index a548d048..0e2f6b85 100644 --- a/wmadec_filter.c +++ b/wmadec_filter.c @@ -96,7 +96,6 @@ struct private_wmadec_data { int next_block_len_bits; ///< log2 of next block length int prev_block_len_bits; ///< log2 of prev block length int block_len; ///< block length in samples - int block_num; ///< block number in current frame int block_pos; ///< current position in frame uint8_t ms_stereo; ///< true if mid/side stereo mode uint8_t channel_coded[MAX_CHANNELS]; ///< true if channel is coded @@ -446,14 +445,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; @@ -1099,7 +1097,6 @@ next: } /* update block number */ - s->block_num++; s->block_pos += s->block_len; if (s->block_pos >= s->frame_len) return 1; @@ -1130,7 +1127,6 @@ static int wma_decode_frame(struct private_wmadec_data *s, int16_t * samples) float *iptr; /* read each block */ - s->block_num = 0; s->block_pos = 0; for (;;) { ret = wma_decode_block(s);