Commit c2d3f068 authored by Michael Niedermayer's avatar Michael Niedermayer

wma: check byte_offset_bits

Fixes assertion failure

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 984add64)
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 01c90eea
......@@ -133,6 +133,10 @@ int ff_wma_init(AVCodecContext * avctx, int flags2)
bps = (float)s->bit_rate / (float)(s->nb_channels * s->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 */
......
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