libavcodec/aacpsy.c:530: error: Uninitialized Value
  The value read from attack_intensity[_] was never initialized.

libavcodec/aacpsy.c:530:21: 
528.         for (i = 0; i < (AAC_NUM_BLOCKS_SHORT + 1) * PSY_LAME_NUM_SUBBLOCKS; i++)
529.             if (!attacks[i / PSY_LAME_NUM_SUBBLOCKS])
530.                 if (attack_intensity[i] > pch->attack_threshold)
                         ^
531.                     attacks[i / PSY_LAME_NUM_SUBBLOCKS] = (i % PSY_LAME_NUM_SUBBLOCKS) + 1;
532. 

static FFPsyWindowInfo psy_lame_window(FFPsyContext *ctx,
                                       const int16_t *audio, const int16_t *la,
                                       int channel, int prev_type)
{
    AacPsyContext *pctx = (AacPsyContext*) ctx->model_priv_data;
    AacPsyChannel *pch  = &pctx->ch[channel];
    int grouping     = 0;
    int uselongblock = 1;
    int attacks[AAC_NUM_BLOCKS_SHORT + 1] = { 0 };
    int i;
    FFPsyWindowInfo wi;
    memset(&wi, 0, sizeof(wi));
    if (la) {
        float hpfsmpl[AAC_BLOCK_SIZE_LONG];
        float const *pf = hpfsmpl;
        float attack_intensity[(AAC_NUM_BLOCKS_SHORT + 1) * PSY_LAME_NUM_SUBBLOCKS];
        float energy_subshort[(AAC_NUM_BLOCKS_SHORT + 1) * PSY_LAME_NUM_SUBBLOCKS];
        float energy_short[AAC_NUM_BLOCKS_SHORT + 1] = { 0 };
        int chans = ctx->avctx->channels;
        const int16_t *firbuf = la + (AAC_BLOCK_SIZE_SHORT/4 - PSY_LAME_FIR_LEN) * chans;
        int j, att_sum = 0;
        for (i = 0; i < AAC_BLOCK_SIZE_LONG; i++) {
            float sum1, sum2;
            sum1 = firbuf[(i + ((PSY_LAME_FIR_LEN - 1) / 2)) * chans];
            sum2 = 0.0;
            for (j = 0; j < ((PSY_LAME_FIR_LEN - 1) / 2) - 1; j += 2) {
                sum1 += psy_fir_coeffs[j] * (firbuf[(i + j) * chans] + firbuf[(i + PSY_LAME_FIR_LEN - j) * chans]);
                sum2 += psy_fir_coeffs[j + 1] * (firbuf[(i + j + 1) * chans] + firbuf[(i + PSY_LAME_FIR_LEN - j - 1) * chans]);
            }
            hpfsmpl[i] = sum1 + sum2;
        }
        for (i = 0; i < PSY_LAME_NUM_SUBBLOCKS; i++) {
            energy_subshort[i] = pch->prev_energy_subshort[i + ((AAC_NUM_BLOCKS_SHORT - 1) * PSY_LAME_NUM_SUBBLOCKS)];
            assert(pch->prev_energy_subshort[i + ((AAC_NUM_BLOCKS_SHORT - 2) * PSY_LAME_NUM_SUBBLOCKS + 1)] > 0);
            attack_intensity[i] = energy_subshort[i] / pch->prev_energy_subshort[i + ((AAC_NUM_BLOCKS_SHORT - 2) * PSY_LAME_NUM_SUBBLOCKS + 1)];
            energy_short[0] += energy_subshort[i];
        }
        for (i = 0; i < AAC_NUM_BLOCKS_SHORT * PSY_LAME_NUM_SUBBLOCKS; i++) {
            float const *const pfe = pf + AAC_BLOCK_SIZE_LONG / (AAC_NUM_BLOCKS_SHORT * PSY_LAME_NUM_SUBBLOCKS);
            float p = 1.0f;
            for (; pf < pfe; pf++)
                if (p < fabsf(*pf))
                    p = fabsf(*pf);
            pch->prev_energy_subshort[i] = energy_subshort[i + PSY_LAME_NUM_SUBBLOCKS] = p;
            energy_short[1 + i / PSY_LAME_NUM_SUBBLOCKS] += p;
            if (p > energy_subshort[i + 1])
                p = p / energy_subshort[i + 1];
            else if (energy_subshort[i + 1] > p * 10.0f)
                p = energy_subshort[i + 1] / (p * 10.0f);
            else
                p = 0.0;
            attack_intensity[i + PSY_LAME_NUM_SUBBLOCKS] = p;
        }
        for (i = 0; i < (AAC_NUM_BLOCKS_SHORT + 1) * PSY_LAME_NUM_SUBBLOCKS; i++)
            if (!attacks[i / PSY_LAME_NUM_SUBBLOCKS])
                if (attack_intensity[i] > pch->attack_threshold)
                    attacks[i / PSY_LAME_NUM_SUBBLOCKS] = (i % PSY_LAME_NUM_SUBBLOCKS) + 1;
        for (i = 1; i < AAC_NUM_BLOCKS_SHORT + 1; i++) {
            float const u = energy_short[i - 1];
            float const v = energy_short[i];
            float const m = FFMAX(u, v);
            if (m < 40000) {
                if (u < 1.7f * v && v < 1.7f * u) {
                    if (i == 1 && attacks[0] < attacks[i])
                        attacks[0] = 0;
                    attacks[i] = 0;
                }
            }
            att_sum += attacks[i];
        }
        if (attacks[0] <= pch->prev_attack)
            attacks[0] = 0;
        att_sum += attacks[0];
        if (pch->prev_attack == 3 || att_sum) {
            uselongblock = 0;
            if (attacks[1] && attacks[0])
                attacks[1] = 0;
            if (attacks[2] && attacks[1])
                attacks[2] = 0;
            if (attacks[3] && attacks[2])
                attacks[3] = 0;
            if (attacks[4] && attacks[3])
                attacks[4] = 0;
            if (attacks[5] && attacks[4])
                attacks[5] = 0;
            if (attacks[6] && attacks[5])
                attacks[6] = 0;
            if (attacks[7] && attacks[6])
                attacks[7] = 0;
            if (attacks[8] && attacks[7])
                attacks[8] = 0;
        }
    } else {
        uselongblock = !(prev_type == EIGHT_SHORT_SEQUENCE);
    }
    lame_apply_block_type(pch, &wi, uselongblock);
    wi.window_type[1] = prev_type;
    if (wi.window_type[0] != EIGHT_SHORT_SEQUENCE) {
        wi.num_windows  = 1;
        wi.grouping[0]  = 1;
        if (wi.window_type[0] == LONG_START_SEQUENCE)
            wi.window_shape = 0;
        else
            wi.window_shape = 1;
    } else {
        int lastgrp = 0;
        wi.num_windows = 8;
        wi.window_shape = 0;
        for (i = 0; i < 8; i++) {
            if (!((pch->next_grouping >> i) & 1))
                lastgrp = i;
            wi.grouping[lastgrp]++;
        }
    }
    for (i = 0; i < 9; i++) {
        if (attacks[i]) {
            grouping = i;
            break;
        }
    }
    pch->next_grouping = window_grouping[grouping];
    pch->prev_attack = attacks[8];
    return wi;
}
['static FFPsyWindowInfo psy_lame_window(FFPsyContext *ctx,\n                                       const int16_t *audio, const int16_t *la,\n                                       int channel, int prev_type)\n{\n    AacPsyContext *pctx = (AacPsyContext*) ctx->model_priv_data;\n    AacPsyChannel *pch  = &pctx->ch[channel];\n    int grouping     = 0;\n    int uselongblock = 1;\n    int attacks[AAC_NUM_BLOCKS_SHORT + 1] = { 0 };\n    int i;\n    FFPsyWindowInfo wi;\n    memset(&wi, 0, sizeof(wi));\n    if (la) {\n        float hpfsmpl[AAC_BLOCK_SIZE_LONG];\n        float const *pf = hpfsmpl;\n        float attack_intensity[(AAC_NUM_BLOCKS_SHORT + 1) * PSY_LAME_NUM_SUBBLOCKS];\n        float energy_subshort[(AAC_NUM_BLOCKS_SHORT + 1) * PSY_LAME_NUM_SUBBLOCKS];\n        float energy_short[AAC_NUM_BLOCKS_SHORT + 1] = { 0 };\n        int chans = ctx->avctx->channels;\n        const int16_t *firbuf = la + (AAC_BLOCK_SIZE_SHORT/4 - PSY_LAME_FIR_LEN) * chans;\n        int j, att_sum = 0;\n        for (i = 0; i < AAC_BLOCK_SIZE_LONG; i++) {\n            float sum1, sum2;\n            sum1 = firbuf[(i + ((PSY_LAME_FIR_LEN - 1) / 2)) * chans];\n            sum2 = 0.0;\n            for (j = 0; j < ((PSY_LAME_FIR_LEN - 1) / 2) - 1; j += 2) {\n                sum1 += psy_fir_coeffs[j] * (firbuf[(i + j) * chans] + firbuf[(i + PSY_LAME_FIR_LEN - j) * chans]);\n                sum2 += psy_fir_coeffs[j + 1] * (firbuf[(i + j + 1) * chans] + firbuf[(i + PSY_LAME_FIR_LEN - j - 1) * chans]);\n            }\n            hpfsmpl[i] = sum1 + sum2;\n        }\n        for (i = 0; i < PSY_LAME_NUM_SUBBLOCKS; i++) {\n            energy_subshort[i] = pch->prev_energy_subshort[i + ((AAC_NUM_BLOCKS_SHORT - 1) * PSY_LAME_NUM_SUBBLOCKS)];\n            assert(pch->prev_energy_subshort[i + ((AAC_NUM_BLOCKS_SHORT - 2) * PSY_LAME_NUM_SUBBLOCKS + 1)] > 0);\n            attack_intensity[i] = energy_subshort[i] / pch->prev_energy_subshort[i + ((AAC_NUM_BLOCKS_SHORT - 2) * PSY_LAME_NUM_SUBBLOCKS + 1)];\n            energy_short[0] += energy_subshort[i];\n        }\n        for (i = 0; i < AAC_NUM_BLOCKS_SHORT * PSY_LAME_NUM_SUBBLOCKS; i++) {\n            float const *const pfe = pf + AAC_BLOCK_SIZE_LONG / (AAC_NUM_BLOCKS_SHORT * PSY_LAME_NUM_SUBBLOCKS);\n            float p = 1.0f;\n            for (; pf < pfe; pf++)\n                if (p < fabsf(*pf))\n                    p = fabsf(*pf);\n            pch->prev_energy_subshort[i] = energy_subshort[i + PSY_LAME_NUM_SUBBLOCKS] = p;\n            energy_short[1 + i / PSY_LAME_NUM_SUBBLOCKS] += p;\n            if (p > energy_subshort[i + 1])\n                p = p / energy_subshort[i + 1];\n            else if (energy_subshort[i + 1] > p * 10.0f)\n                p = energy_subshort[i + 1] / (p * 10.0f);\n            else\n                p = 0.0;\n            attack_intensity[i + PSY_LAME_NUM_SUBBLOCKS] = p;\n        }\n        for (i = 0; i < (AAC_NUM_BLOCKS_SHORT + 1) * PSY_LAME_NUM_SUBBLOCKS; i++)\n            if (!attacks[i / PSY_LAME_NUM_SUBBLOCKS])\n                if (attack_intensity[i] > pch->attack_threshold)\n                    attacks[i / PSY_LAME_NUM_SUBBLOCKS] = (i % PSY_LAME_NUM_SUBBLOCKS) + 1;\n        for (i = 1; i < AAC_NUM_BLOCKS_SHORT + 1; i++) {\n            float const u = energy_short[i - 1];\n            float const v = energy_short[i];\n            float const m = FFMAX(u, v);\n            if (m < 40000) {\n                if (u < 1.7f * v && v < 1.7f * u) {\n                    if (i == 1 && attacks[0] < attacks[i])\n                        attacks[0] = 0;\n                    attacks[i] = 0;\n                }\n            }\n            att_sum += attacks[i];\n        }\n        if (attacks[0] <= pch->prev_attack)\n            attacks[0] = 0;\n        att_sum += attacks[0];\n        if (pch->prev_attack == 3 || att_sum) {\n            uselongblock = 0;\n            if (attacks[1] && attacks[0])\n                attacks[1] = 0;\n            if (attacks[2] && attacks[1])\n                attacks[2] = 0;\n            if (attacks[3] && attacks[2])\n                attacks[3] = 0;\n            if (attacks[4] && attacks[3])\n                attacks[4] = 0;\n            if (attacks[5] && attacks[4])\n                attacks[5] = 0;\n            if (attacks[6] && attacks[5])\n                attacks[6] = 0;\n            if (attacks[7] && attacks[6])\n                attacks[7] = 0;\n            if (attacks[8] && attacks[7])\n                attacks[8] = 0;\n        }\n    } else {\n        uselongblock = !(prev_type == EIGHT_SHORT_SEQUENCE);\n    }\n    lame_apply_block_type(pch, &wi, uselongblock);\n    wi.window_type[1] = prev_type;\n    if (wi.window_type[0] != EIGHT_SHORT_SEQUENCE) {\n        wi.num_windows  = 1;\n        wi.grouping[0]  = 1;\n        if (wi.window_type[0] == LONG_START_SEQUENCE)\n            wi.window_shape = 0;\n        else\n            wi.window_shape = 1;\n    } else {\n        int lastgrp = 0;\n        wi.num_windows = 8;\n        wi.window_shape = 0;\n        for (i = 0; i < 8; i++) {\n            if (!((pch->next_grouping >> i) & 1))\n                lastgrp = i;\n            wi.grouping[lastgrp]++;\n        }\n    }\n    for (i = 0; i < 9; i++) {\n        if (attacks[i]) {\n            grouping = i;\n            break;\n        }\n    }\n    pch->next_grouping = window_grouping[grouping];\n    pch->prev_attack = attacks[8];\n    return wi;\n}']