aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-01-30 22:56:45 +0100
committerMichael Niedermayer <michaelni@gmx.at>2013-02-20 01:23:54 +0100
commit5af2fd317d841f50390ada3b6e8d6618bcd82cb0 (patch)
treebd4a32ee83c8716b347833e7ce2289e9a5315181 /libavcodec
parent8aedb751567457d6f0d16ba3c5b6400f99791fb7 (diff)
downloadffmpeg-5af2fd317d841f50390ada3b6e8d6618bcd82cb0.tar.gz
wma: check byte_offset_bits
Fixes assertion failure Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at> (cherry picked from commit 984add64a41c3296a8a82051cc90bff2eb449609) Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/wma.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libavcodec/wma.c b/libavcodec/wma.c
index feb121b591..2e8ac979a5 100644
--- a/libavcodec/wma.c
+++ b/libavcodec/wma.c
@@ -177,6 +177,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 */