summaryrefslogtreecommitdiff
path: root/libavcodec/wmadec.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2011-04-25 16:16:44 +0200
committerMichael Niedermayer <michaelni@gmx.at>2011-04-26 02:44:33 +0200
commit7157334c375b7623dd52314d45cef3700896d0fe (patch)
tree03c278ba0fd69eb539db810be3d8132c75bce19a /libavcodec/wmadec.c
parent1da254b849d9bc8cc100afde86b225d467857a11 (diff)
wmadec: prevent null pointer call.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/wmadec.c')
-rw-r--r--libavcodec/wmadec.c5
1 files changed, 5 insertions, 0 deletions
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){