Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2020-11-04 07:20:10 +0300
committerAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2020-11-24 13:35:03 +0300
commit92209cf4c9be74197a1585e656443fedf215b344 (patch)
treedf5dd95e386441e4dde64f2ab5bb48158b6ec6ea /libavcodec/atrac9dec.c
parent0339af05a4eaa1adbf153b7fa2213eea7e531573 (diff)
avcodec/atrac9dec: Don't confuse max_depth of VLC with max codelength
The whole point of VLCs with their tables is to read more than one bit at a time; therefore max_depth, the number of times one has to (maximally) read further bits is given by ceil(max_code_length / table_bits) which in the case of ATRAC9's coefficient VLCs gives an upper bound of two. Instead the maximum length of a code of the given VLC has been used (which is not even a compile-time constant). Use two instead. Furthermore, given that this was the only usage of the field containing the maximum of all the code lengths of a given VLC the field has been removed from its containing struct. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Diffstat (limited to 'libavcodec/atrac9dec.c')
-rw-r--r--libavcodec/atrac9dec.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/atrac9dec.c b/libavcodec/atrac9dec.c
index 075d610e75..a1af3c22ef 100644
--- a/libavcodec/atrac9dec.c
+++ b/libavcodec/atrac9dec.c
@@ -411,7 +411,7 @@ static inline void read_coeffs_coarse(ATRAC9Context *s, ATRAC9BlockData *b,
const int groups = bands >> huff->value_cnt_pow;
for (int j = 0; j < groups; j++) {
- uint16_t val = get_vlc2(gb, tab->table, 9, huff->max_bit_size);
+ uint16_t val = get_vlc2(gb, tab->table, 9, 2);
for (int k = 0; k < huff->value_cnt; k++) {
coeffs[k] = sign_extend(val, huff->value_bits);