diff options
author | Chris Warrington <cwarrington@synamedia.com> | 2024-12-02 14:27:12 +0000 |
---|---|---|
committer | Nuo Mi <nuomi2021@gmail.com> | 2025-01-05 18:00:18 +0800 |
commit | f80af3657f162ba79b872bc27ae06d75560d58a9 (patch) | |
tree | c425a5ab664c15f7e17ffd17a5848f71be249a90 | |
parent | 2919767750da9acc9042fcc2b8fa3e134cfd16c9 (diff) | |
download | ffmpeg-f80af3657f162ba79b872bc27ae06d75560d58a9.tar.gz |
avcodec/vvc decode: ALF filtering without CC-ALF
When a stream has ALF filtering enabled but not CC-ALF, the CC-ALF set indexes alf->ctb_cc_idc are being read uninitialized during ALF filtering.
This change initializes alf->ctb_cc_idc whenever ALF is enabled.
Ref. https://trac.ffmpeg.org/ticket/11325
-rw-r--r-- | libavcodec/vvc/ctu.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/vvc/ctu.c b/libavcodec/vvc/ctu.c index f80bce637c..83864c5d98 100644 --- a/libavcodec/vvc/ctu.c +++ b/libavcodec/vvc/ctu.c @@ -2294,6 +2294,7 @@ static void alf_params(VVCLocalContext *lc, const int rx, const int ry) ALFParams *alf = &CTB(fc->tab.alf, rx, ry); alf->ctb_flag[LUMA] = alf->ctb_flag[CB] = alf->ctb_flag[CR] = 0; + alf->ctb_cc_idc[0] = alf->ctb_cc_idc[1] = 0; if (sh->sh_alf_enabled_flag) { alf->ctb_flag[LUMA] = ff_vvc_alf_ctb_flag(lc, rx, ry, LUMA); if (alf->ctb_flag[LUMA]) { @@ -2324,7 +2325,6 @@ static void alf_params(VVCLocalContext *lc, const int rx, const int ry) const uint8_t cc_enabled[] = { sh->sh_alf_cc_cb_enabled_flag, sh->sh_alf_cc_cr_enabled_flag }; const uint8_t cc_aps_id[] = { sh->sh_alf_cc_cb_aps_id, sh->sh_alf_cc_cr_aps_id }; for (int i = 0; i < 2; i++) { - alf->ctb_cc_idc[i] = 0; if (cc_enabled[i]) { const VVCALF *aps = fc->ps.alf_list[cc_aps_id[i]]; alf->ctb_cc_idc[i] = ff_vvc_alf_ctb_cc_idc(lc, rx, ry, i, aps->num_cc_filters[i]); |