wma: initialize prev_block_len_bits, next_block_len_bits, and block_len_bits.
authorJustin Ruggles <justin.ruggles@gmail.com>
Tue, 22 Nov 2011 18:37:52 +0000 (13:37 -0500)
committerJustin Ruggles <justin.ruggles@gmail.com>
Tue, 22 Nov 2011 18:50:18 +0000 (13:50 -0500)
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.

libavcodec/wma.c

index bed47ec35bdb64cc80cf11bbd87e1e4175544d9c..4cdffcd1013e9e17df085c23440ac8e17397e1ec 100644 (file)
@@ -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) {