diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-01-31 01:56:45 +0400 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-01-31 02:12:57 +0400 |
commit | 984add64a41c3296a8a82051cc90bff2eb449609 (patch) | |
tree | 58477b0fb88ab9f97527e12769aae0a49ab565b9 | |
parent | 033f1644b59abd755bb529afa5db394d18d9c30b (diff) |
wma: check byte_offset_bits
Fixes assertion failure
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavcodec/wma.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libavcodec/wma.c b/libavcodec/wma.c index 5af20739a5..1e6ca61047 100644 --- a/libavcodec/wma.c +++ b/libavcodec/wma.c @@ -134,6 +134,10 @@ int ff_wma_init(AVCodecContext *avctx, int flags2) bps = (float)avctx->bit_rate / (float)(avctx->channels * avctx->sample_rate); s->byte_offset_bits = av_log2((int)(bps * s->frame_len / 8.0 + 0.5)) + 2; + if (s->byte_offset_bits + 3 > MIN_CACHE_BITS) { + av_log(avctx, AV_LOG_ERROR, "byte_offset_bits %d is too large\n", s->byte_offset_bits); + return AVERROR_PATCHWELCOME; + } /* compute high frequency value and choose if noise coding should be activated */ |