You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-15 14:13:16 +02:00
wma: fix infinite loop
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
@@ -828,6 +828,7 @@ 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);
|
||||||
|
if(s->block_align)
|
||||||
buf_size = s->block_align;
|
buf_size = s->block_align;
|
||||||
|
|
||||||
samples = data;
|
samples = data;
|
||||||
@@ -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;
|
||||||
|
Reference in New Issue
Block a user