diff options
author | summertriangle.dev@gmail.com <summertriangle.dev@gmail.com> | 2020-06-17 14:45:06 -0700 |
---|---|---|
committer | Paul B Mahol <onemda@gmail.com> | 2020-06-21 11:13:29 +0200 |
commit | bc2dcae897da64349d690b9e2f951a63b97309fd (patch) | |
tree | 452b4f35374b23d3661e8b0943b4820e7129a1c4 /libavcodec/hcadec.c | |
parent | 536e5dfa73b0c5e87deb7f36d22dcc784b3570de (diff) |
avcodec/hcadec: fix decoding of hfr channels
I suspect this was originally broken by b7e5c8f , but even
then, it only worked because it read out of bounds from
intensity_ratio_table.
Signed-off-by: t <summertriangle.dev@gmail.com>
Diffstat (limited to 'libavcodec/hcadec.c')
-rw-r--r-- | libavcodec/hcadec.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libavcodec/hcadec.c b/libavcodec/hcadec.c index 5fa87319d2..a890e75a13 100644 --- a/libavcodec/hcadec.c +++ b/libavcodec/hcadec.c @@ -287,7 +287,8 @@ static void reconstruct_hfr(HCAContext *s, ChannelContext *ch, for (int i = 0, k = start_band, l = start_band - 1; i < hfr_group_count; i++){ for (int j = 0; j < bands_per_hfr_group && k < total_band_count && l >= 0; j++, k++, l--){ - ch->imdct_in[k] = scale_conversion_table[ (ch->hfr_scale[i] - ch->scale_factors[l]) & 63 ] * ch->imdct_in[l]; + ch->imdct_in[k] = scale_conversion_table[ scale_conv_bias + + av_clip_intp2(ch->hfr_scale[i] - ch->scale_factors[l], 6) ] * ch->imdct_in[l]; } } |