From: Laurent Bigonville <[email protected]> In some situations, transcoding a wmav2 file can lead to a infinite loop (which is leaking a lot of memory).
CC: [email protected] --- libavcodec/wmadec.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) For full context of this patch, please cf. http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=695593 and http://avcodec.org/trac/ffmpeg/ticket/286. Cheers, Reinhard diff --git a/libavcodec/wmadec.c b/libavcodec/wmadec.c index b9b176e..5d0aac7 100644 --- a/libavcodec/wmadec.c +++ b/libavcodec/wmadec.c @@ -812,7 +812,8 @@ static int wma_decode_superframe(AVCodecContext *avctx, void *data, buf_size, avctx->block_align); return AVERROR_INVALIDDATA; } - buf_size = avctx->block_align; + if(avctx->block_align) + buf_size = avctx->block_align; init_get_bits(&s->gb, buf, buf_size*8); @@ -911,7 +912,7 @@ static int wma_decode_superframe(AVCodecContext *avctx, void *data, *got_frame_ptr = 1; - return avctx->block_align; + return buf_size; fail: /* when error, we reset the bit reservoir */ s->last_superframe_len = 0; -- 1.8.1.2 _______________________________________________ libav-devel mailing list [email protected] https://lists.libav.org/mailman/listinfo/libav-devel
