From 7157334c375b7623dd52314d45cef3700896d0fe Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Mon, 25 Apr 2011 16:16:44 +0200 Subject: wmadec: prevent null pointer call. Signed-off-by: Michael Niedermayer --- libavcodec/wmadec.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'libavcodec/wmadec.c') diff --git a/libavcodec/wmadec.c b/libavcodec/wmadec.c index 5382999cb0..fa20bea1e0 100644 --- a/libavcodec/wmadec.c +++ b/libavcodec/wmadec.c @@ -489,6 +489,11 @@ static int wma_decode_block(WMACodecContext *s) s->block_len_bits = s->frame_len_bits; } + if (s->frame_len_bits - s->block_len_bits >= s->nb_block_sizes){ + av_log(s->avctx, AV_LOG_ERROR, "block_len_bits not initialized to a valid value\n"); + return -1; + } + /* now check if the block length is coherent with the frame length */ s->block_len = 1 << s->block_len_bits; if ((s->block_pos + s->block_len) > s->frame_len){ -- cgit v1.2.3