libavcodec/hevc.c:312: error: Uninitialized Value
  The value read from luma_weight_l1_flag[_] was never initialized.

libavcodec/hevc.c:312:17: 
310.         }
311.         for (i = 0; i < s->sh.nb_refs[L1]; i++) {
312.             if (luma_weight_l1_flag[i]) {
                     ^
313.                 int delta_luma_weight_l1 = get_se_golomb(gb);
314.                 s->sh.luma_weight_l1[i] = (1 << s->sh.luma_log2_weight_denom) + delta_luma_weight_l1;

static void pred_weight_table(HEVCContext *s, GetBitContext *gb)
{
    int i = 0;
    int j = 0;
    uint8_t luma_weight_l0_flag[16];
    uint8_t chroma_weight_l0_flag[16];
    uint8_t luma_weight_l1_flag[16];
    uint8_t chroma_weight_l1_flag[16];
    s->sh.luma_log2_weight_denom = get_ue_golomb_long(gb);
    if (s->sps->chroma_format_idc != 0) {
        int delta = get_se_golomb(gb);
        s->sh.chroma_log2_weight_denom = av_clip_c(s->sh.luma_log2_weight_denom + delta, 0, 7);
    }
    for (i = 0; i < s->sh.nb_refs[L0]; i++) {
        luma_weight_l0_flag[i] = get_bits1(gb);
        if (!luma_weight_l0_flag[i]) {
            s->sh.luma_weight_l0[i] = 1 << s->sh.luma_log2_weight_denom;
            s->sh.luma_offset_l0[i] = 0;
        }
    }
    if (s->sps->chroma_format_idc != 0) {
        for (i = 0; i < s->sh.nb_refs[L0]; i++)
            chroma_weight_l0_flag[i] = get_bits1(gb);
    } else {
        for (i = 0; i < s->sh.nb_refs[L0]; i++)
            chroma_weight_l0_flag[i] = 0;
    }
    for (i = 0; i < s->sh.nb_refs[L0]; i++) {
        if (luma_weight_l0_flag[i]) {
            int delta_luma_weight_l0 = get_se_golomb(gb);
            s->sh.luma_weight_l0[i] = (1 << s->sh.luma_log2_weight_denom) + delta_luma_weight_l0;
            s->sh.luma_offset_l0[i] = get_se_golomb(gb);
        }
        if (chroma_weight_l0_flag[i]) {
            for (j = 0; j < 2; j++) {
                int delta_chroma_weight_l0 = get_se_golomb(gb);
                int delta_chroma_offset_l0 = get_se_golomb(gb);
                s->sh.chroma_weight_l0[i][j] = (1 << s->sh.chroma_log2_weight_denom) + delta_chroma_weight_l0;
                s->sh.chroma_offset_l0[i][j] = av_clip_c((delta_chroma_offset_l0 - ((128 * s->sh.chroma_weight_l0[i][j])
                                                                                    >> s->sh.chroma_log2_weight_denom) + 128), -128, 127);
            }
        } else {
            s->sh.chroma_weight_l0[i][0] = 1 << s->sh.chroma_log2_weight_denom;
            s->sh.chroma_offset_l0[i][0] = 0;
            s->sh.chroma_weight_l0[i][1] = 1 << s->sh.chroma_log2_weight_denom;
            s->sh.chroma_offset_l0[i][1] = 0;
        }
    }
    if (s->sh.slice_type == B_SLICE) {
        for (i = 0; i < s->sh.nb_refs[L1]; i++) {
            luma_weight_l1_flag[i] = get_bits1(gb);
            if (!luma_weight_l1_flag[i]) {
                s->sh.luma_weight_l1[i] = 1 << s->sh.luma_log2_weight_denom;
                s->sh.luma_offset_l1[i] = 0;
            }
        }
        if (s->sps->chroma_format_idc != 0) {
            for (i = 0; i < s->sh.nb_refs[L1]; i++)
                chroma_weight_l1_flag[i] = get_bits1(gb);
        } else {
            for (i = 0; i < s->sh.nb_refs[L1]; i++)
                chroma_weight_l1_flag[i] = 0;
        }
        for (i = 0; i < s->sh.nb_refs[L1]; i++) {
            if (luma_weight_l1_flag[i]) {
                int delta_luma_weight_l1 = get_se_golomb(gb);
                s->sh.luma_weight_l1[i] = (1 << s->sh.luma_log2_weight_denom) + delta_luma_weight_l1;
                s->sh.luma_offset_l1[i] = get_se_golomb(gb);
            }
            if (chroma_weight_l1_flag[i]) {
                for (j = 0; j < 2; j++) {
                    int delta_chroma_weight_l1 = get_se_golomb(gb);
                    int delta_chroma_offset_l1 = get_se_golomb(gb);
                    s->sh.chroma_weight_l1[i][j] = (1 << s->sh.chroma_log2_weight_denom) + delta_chroma_weight_l1;
                    s->sh.chroma_offset_l1[i][j] = av_clip_c((delta_chroma_offset_l1 - ((128 * s->sh.chroma_weight_l1[i][j])
                                                                                        >> s->sh.chroma_log2_weight_denom) + 128), -128, 127);
                }
            } else {
                s->sh.chroma_weight_l1[i][0] = 1 << s->sh.chroma_log2_weight_denom;
                s->sh.chroma_offset_l1[i][0] = 0;
                s->sh.chroma_weight_l1[i][1] = 1 << s->sh.chroma_log2_weight_denom;
                s->sh.chroma_offset_l1[i][1] = 0;
            }
        }
    }
}
['static void pred_weight_table(HEVCContext *s, GetBitContext *gb)\n{\n    int i = 0;\n    int j = 0;\n    uint8_t luma_weight_l0_flag[16];\n    uint8_t chroma_weight_l0_flag[16];\n    uint8_t luma_weight_l1_flag[16];\n    uint8_t chroma_weight_l1_flag[16];\n    s->sh.luma_log2_weight_denom = get_ue_golomb_long(gb);\n    if (s->sps->chroma_format_idc != 0) {\n        int delta = get_se_golomb(gb);\n        s->sh.chroma_log2_weight_denom = av_clip_c(s->sh.luma_log2_weight_denom + delta, 0, 7);\n    }\n    for (i = 0; i < s->sh.nb_refs[L0]; i++) {\n        luma_weight_l0_flag[i] = get_bits1(gb);\n        if (!luma_weight_l0_flag[i]) {\n            s->sh.luma_weight_l0[i] = 1 << s->sh.luma_log2_weight_denom;\n            s->sh.luma_offset_l0[i] = 0;\n        }\n    }\n    if (s->sps->chroma_format_idc != 0) {\n        for (i = 0; i < s->sh.nb_refs[L0]; i++)\n            chroma_weight_l0_flag[i] = get_bits1(gb);\n    } else {\n        for (i = 0; i < s->sh.nb_refs[L0]; i++)\n            chroma_weight_l0_flag[i] = 0;\n    }\n    for (i = 0; i < s->sh.nb_refs[L0]; i++) {\n        if (luma_weight_l0_flag[i]) {\n            int delta_luma_weight_l0 = get_se_golomb(gb);\n            s->sh.luma_weight_l0[i] = (1 << s->sh.luma_log2_weight_denom) + delta_luma_weight_l0;\n            s->sh.luma_offset_l0[i] = get_se_golomb(gb);\n        }\n        if (chroma_weight_l0_flag[i]) {\n            for (j = 0; j < 2; j++) {\n                int delta_chroma_weight_l0 = get_se_golomb(gb);\n                int delta_chroma_offset_l0 = get_se_golomb(gb);\n                s->sh.chroma_weight_l0[i][j] = (1 << s->sh.chroma_log2_weight_denom) + delta_chroma_weight_l0;\n                s->sh.chroma_offset_l0[i][j] = av_clip_c((delta_chroma_offset_l0 - ((128 * s->sh.chroma_weight_l0[i][j])\n                                                                                    >> s->sh.chroma_log2_weight_denom) + 128), -128, 127);\n            }\n        } else {\n            s->sh.chroma_weight_l0[i][0] = 1 << s->sh.chroma_log2_weight_denom;\n            s->sh.chroma_offset_l0[i][0] = 0;\n            s->sh.chroma_weight_l0[i][1] = 1 << s->sh.chroma_log2_weight_denom;\n            s->sh.chroma_offset_l0[i][1] = 0;\n        }\n    }\n    if (s->sh.slice_type == B_SLICE) {\n        for (i = 0; i < s->sh.nb_refs[L1]; i++) {\n            luma_weight_l1_flag[i] = get_bits1(gb);\n            if (!luma_weight_l1_flag[i]) {\n                s->sh.luma_weight_l1[i] = 1 << s->sh.luma_log2_weight_denom;\n                s->sh.luma_offset_l1[i] = 0;\n            }\n        }\n        if (s->sps->chroma_format_idc != 0) {\n            for (i = 0; i < s->sh.nb_refs[L1]; i++)\n                chroma_weight_l1_flag[i] = get_bits1(gb);\n        } else {\n            for (i = 0; i < s->sh.nb_refs[L1]; i++)\n                chroma_weight_l1_flag[i] = 0;\n        }\n        for (i = 0; i < s->sh.nb_refs[L1]; i++) {\n            if (luma_weight_l1_flag[i]) {\n                int delta_luma_weight_l1 = get_se_golomb(gb);\n                s->sh.luma_weight_l1[i] = (1 << s->sh.luma_log2_weight_denom) + delta_luma_weight_l1;\n                s->sh.luma_offset_l1[i] = get_se_golomb(gb);\n            }\n            if (chroma_weight_l1_flag[i]) {\n                for (j = 0; j < 2; j++) {\n                    int delta_chroma_weight_l1 = get_se_golomb(gb);\n                    int delta_chroma_offset_l1 = get_se_golomb(gb);\n                    s->sh.chroma_weight_l1[i][j] = (1 << s->sh.chroma_log2_weight_denom) + delta_chroma_weight_l1;\n                    s->sh.chroma_offset_l1[i][j] = av_clip_c((delta_chroma_offset_l1 - ((128 * s->sh.chroma_weight_l1[i][j])\n                                                                                        >> s->sh.chroma_log2_weight_denom) + 128), -128, 127);\n                }\n            } else {\n                s->sh.chroma_weight_l1[i][0] = 1 << s->sh.chroma_log2_weight_denom;\n                s->sh.chroma_offset_l1[i][0] = 0;\n                s->sh.chroma_weight_l1[i][1] = 1 << s->sh.chroma_log2_weight_denom;\n                s->sh.chroma_offset_l1[i][1] = 0;\n            }\n        }\n    }\n}']