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.
(cherry picked from commit 05d1e45d1f42cc90d1f2f36c546d0096cea126a8)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
... | ... |
@@ -137,6 +137,9 @@ int ff_wma_init(AVCodecContext *avctx, int flags2) |
137 | 137 |
|
138 | 138 |
/* compute MDCT block size */ |
139 | 139 |
s->frame_len_bits = ff_wma_get_frame_len_bits(s->sample_rate, s->version, 0); |
140 |
+ s->next_block_len_bits = s->frame_len_bits; |
|
141 |
+ s->prev_block_len_bits = s->frame_len_bits; |
|
142 |
+ s->block_len_bits = s->frame_len_bits; |
|
140 | 143 |
|
141 | 144 |
s->frame_len = 1 << s->frame_len_bits; |
142 | 145 |
if (s->use_variable_block_len) { |