diff options
author | Justin Ruggles <justin.ruggles@gmail.com> | 2011-11-22 13:37:52 -0500 |
---|---|---|
committer | Justin Ruggles <justin.ruggles@gmail.com> | 2011-11-22 13:50:18 -0500 |
commit | 05d1e45d1f42cc90d1f2f36c546d0096cea126a8 (patch) | |
tree | 97663edc4a7b82907fc9fa585ff315af0d9522ee /libavcodec/wma.c | |
parent | 9f8c190bb0f713832e10c5ba1723617acd6bf72c (diff) | |
download | ffmpeg-05d1e45d1f42cc90d1f2f36c546d0096cea126a8.tar.gz |
wma: initialize prev_block_len_bits, next_block_len_bits, and block_len_bits.
The initial values are not checked against the number of block sizes.
Initializing them to frame_len_bits will result in a block size index of 0
in these cases instead of something that might be out-of-range.
Fixes Bug 81.
Diffstat (limited to 'libavcodec/wma.c')
-rw-r--r-- | libavcodec/wma.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/libavcodec/wma.c b/libavcodec/wma.c index bed47ec35b..4cdffcd101 100644 --- a/libavcodec/wma.c +++ b/libavcodec/wma.c @@ -137,6 +137,9 @@ int ff_wma_init(AVCodecContext *avctx, int flags2) /* compute MDCT block size */ s->frame_len_bits = ff_wma_get_frame_len_bits(s->sample_rate, s->version, 0); + s->next_block_len_bits = s->frame_len_bits; + s->prev_block_len_bits = s->frame_len_bits; + s->block_len_bits = s->frame_len_bits; s->frame_len = 1 << s->frame_len_bits; if (s->use_variable_block_len) { |