aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2011-06-21 13:17:10 +0200
committerMichael Niedermayer <michaelni@gmx.at>2011-06-21 13:17:10 +0200
commit3cb64e327a9861f2c8fff0b3850fcd5d14acdbe3 (patch)
treec59f8a5341b42d157fb9ef28848ca8a56d33d0cd
parentda0dadb936f101b8a7a111fd255e12063c3af9f3 (diff)
downloadffmpeg-3cb64e327a9861f2c8fff0b3850fcd5d14acdbe3.tar.gz
wma: fix infinite loop
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavcodec/wmadec.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/libavcodec/wmadec.c b/libavcodec/wmadec.c
index 840025d493..9eaf230b01 100644
--- a/libavcodec/wmadec.c
+++ b/libavcodec/wmadec.c
@@ -828,7 +828,8 @@ static int wma_decode_superframe(AVCodecContext *avctx,
}
if (buf_size < s->block_align)
return AVERROR(EINVAL);
- buf_size = s->block_align;
+ if(s->block_align)
+ buf_size = s->block_align;
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);
-
*data_size = (int8_t *)samples - (int8_t *)data;
- return s->block_align;
+ return buf_size;
fail:
/* when error, we reset the bit reservoir */
s->last_superframe_len = 0;