Commit 3cb64e32 authored by Michael Niedermayer's avatar Michael Niedermayer

wma: fix infinite loop

Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent da0dadb9
...@@ -828,7 +828,8 @@ static int wma_decode_superframe(AVCodecContext *avctx, ...@@ -828,7 +828,8 @@ static int wma_decode_superframe(AVCodecContext *avctx,
} }
if (buf_size < s->block_align) if (buf_size < s->block_align)
return AVERROR(EINVAL); return AVERROR(EINVAL);
buf_size = s->block_align; if(s->block_align)
buf_size = s->block_align;
samples = data; samples = data;
...@@ -911,9 +912,8 @@ static int wma_decode_superframe(AVCodecContext *avctx, ...@@ -911,9 +912,8 @@ static int wma_decode_superframe(AVCodecContext *avctx,
} }
//av_log(NULL, AV_LOG_ERROR, "%d %d %d %d outbytes:%d eaten:%d\n", s->frame_len_bits, s->block_len_bits, s->frame_len, s->block_len, (int8_t *)samples - (int8_t *)data, s->block_align); //av_log(NULL, AV_LOG_ERROR, "%d %d %d %d outbytes:%d eaten:%d\n", s->frame_len_bits, s->block_len_bits, s->frame_len, s->block_len, (int8_t *)samples - (int8_t *)data, s->block_align);
*data_size = (int8_t *)samples - (int8_t *)data; *data_size = (int8_t *)samples - (int8_t *)data;
return s->block_align; return buf_size;
fail: fail:
/* when error, we reset the bit reservoir */ /* when error, we reset the bit reservoir */
s->last_superframe_len = 0; s->last_superframe_len = 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment