Browse Source

wmadec: prevent null pointer call.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
tags/n0.8
Michael Niedermayer 15 years ago
parent
commit
7157334c37
1 changed files with 5 additions and 0 deletions
  1. +5
    -0
      libavcodec/wmadec.c

+ 5
- 0
libavcodec/wmadec.c View File

@@ -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){


Loading…
Cancel
Save