libavcodec/h264_refs.c:152: error: Uninitialized Value
  The value read from lens[_] was never initialized.

libavcodec/h264_refs.c:152:35: 
150.         }
151. 
152.         if (lens[0] == lens[1] && lens[1] > 1) {
                                       ^
153.             for (i = 0; i < lens[0] &&
154.                         h->default_ref_list[0][i].parent->f->buf[0]->buffer ==

int ff_h264_fill_default_ref_list(H264Context *h, H264SliceContext *sl)
{
    int i, len;
    if (sl->slice_type_nos == AV_PICTURE_TYPE_B) {
        H264Picture *sorted[32];
        int cur_poc, list;
        int lens[2];
        if (FIELD_PICTURE(h))
            cur_poc = h->cur_pic_ptr->field_poc[h->picture_structure == PICT_BOTTOM_FIELD];
        else
            cur_poc = h->cur_pic_ptr->poc;
        for (list = 0; list < 2; list++) {
            len  = add_sorted(sorted,       h->short_ref, h->short_ref_count, cur_poc, 1 ^ list);
            len += add_sorted(sorted + len, h->short_ref, h->short_ref_count, cur_poc, 0 ^ list);
            assert(len <= 32);
            len  = build_def_list(h->default_ref_list[list], FF_ARRAY_ELEMS(h->default_ref_list[0]),
                                  sorted, len, 0, h->picture_structure);
            len += build_def_list(h->default_ref_list[list] + len,
                                  FF_ARRAY_ELEMS(h->default_ref_list[0]) - len,
                                  h->long_ref, 16, 1, h->picture_structure);
            if (len < sl->ref_count[list])
                memset(&h->default_ref_list[list][len], 0, sizeof(H264Ref) * (sl->ref_count[list] - len));
            lens[list] = len;
        }
        if (lens[0] == lens[1] && lens[1] > 1) {
            for (i = 0; i < lens[0] &&
                        h->default_ref_list[0][i].parent->f->buf[0]->buffer ==
                        h->default_ref_list[1][i].parent->f->buf[0]->buffer; i++);
            if (i == lens[0]) {
                FFSWAP(H264Ref, h->default_ref_list[1][0], h->default_ref_list[1][1]);
            }
        }
    } else {
        len  = build_def_list(h->default_ref_list[0], FF_ARRAY_ELEMS(h->default_ref_list[0]),
                              h->short_ref, h->short_ref_count, 0, h->picture_structure);
        len += build_def_list(h->default_ref_list[0] + len,
                              FF_ARRAY_ELEMS(h->default_ref_list[0]) - len,
                              h-> long_ref, 16, 1, h->picture_structure);
        if (len < sl->ref_count[0])
            memset(&h->default_ref_list[0][len], 0, sizeof(H264Ref) * (sl->ref_count[0] - len));
    }
#ifdef TRACE
    for (i = 0; i < sl->ref_count[0]; i++) {
        ff_tlog(h->avctx, "List0: %s fn:%d 0x%p\n",
                (h->default_ref_list[0][i].long_ref ? "LT" : "ST"),
                h->default_ref_list[0][i].pic_id,
                h->default_ref_list[0][i].f->data[0]);
    }
    if (sl->slice_type_nos == AV_PICTURE_TYPE_B) {
        for (i = 0; i < sl->ref_count[1]; i++) {
            ff_tlog(h->avctx, "List1: %s fn:%d 0x%p\n",
                    (h->default_ref_list[1][i].long_ref ? "LT" : "ST"),
                    h->default_ref_list[1][i].pic_id,
                    h->default_ref_list[1][i].f->data[0]);
        }
    }
#endif
    return 0;
}
['int ff_h264_fill_default_ref_list(H264Context *h, H264SliceContext *sl)\n{\n    int i, len;\n    if (sl->slice_type_nos == AV_PICTURE_TYPE_B) {\n        H264Picture *sorted[32];\n        int cur_poc, list;\n        int lens[2];\n        if (FIELD_PICTURE(h))\n            cur_poc = h->cur_pic_ptr->field_poc[h->picture_structure == PICT_BOTTOM_FIELD];\n        else\n            cur_poc = h->cur_pic_ptr->poc;\n        for (list = 0; list < 2; list++) {\n            len  = add_sorted(sorted,       h->short_ref, h->short_ref_count, cur_poc, 1 ^ list);\n            len += add_sorted(sorted + len, h->short_ref, h->short_ref_count, cur_poc, 0 ^ list);\n            assert(len <= 32);\n            len  = build_def_list(h->default_ref_list[list], FF_ARRAY_ELEMS(h->default_ref_list[0]),\n                                  sorted, len, 0, h->picture_structure);\n            len += build_def_list(h->default_ref_list[list] + len,\n                                  FF_ARRAY_ELEMS(h->default_ref_list[0]) - len,\n                                  h->long_ref, 16, 1, h->picture_structure);\n            if (len < sl->ref_count[list])\n                memset(&h->default_ref_list[list][len], 0, sizeof(H264Ref) * (sl->ref_count[list] - len));\n            lens[list] = len;\n        }\n        if (lens[0] == lens[1] && lens[1] > 1) {\n            for (i = 0; i < lens[0] &&\n                        h->default_ref_list[0][i].parent->f->buf[0]->buffer ==\n                        h->default_ref_list[1][i].parent->f->buf[0]->buffer; i++);\n            if (i == lens[0]) {\n                FFSWAP(H264Ref, h->default_ref_list[1][0], h->default_ref_list[1][1]);\n            }\n        }\n    } else {\n        len  = build_def_list(h->default_ref_list[0], FF_ARRAY_ELEMS(h->default_ref_list[0]),\n                              h->short_ref, h->short_ref_count, 0, h->picture_structure);\n        len += build_def_list(h->default_ref_list[0] + len,\n                              FF_ARRAY_ELEMS(h->default_ref_list[0]) - len,\n                              h-> long_ref, 16, 1, h->picture_structure);\n        if (len < sl->ref_count[0])\n            memset(&h->default_ref_list[0][len], 0, sizeof(H264Ref) * (sl->ref_count[0] - len));\n    }\n#ifdef TRACE\n    for (i = 0; i < sl->ref_count[0]; i++) {\n        ff_tlog(h->avctx, "List0: %s fn:%d 0x%p\\n",\n                (h->default_ref_list[0][i].long_ref ? "LT" : "ST"),\n                h->default_ref_list[0][i].pic_id,\n                h->default_ref_list[0][i].f->data[0]);\n    }\n    if (sl->slice_type_nos == AV_PICTURE_TYPE_B) {\n        for (i = 0; i < sl->ref_count[1]; i++) {\n            ff_tlog(h->avctx, "List1: %s fn:%d 0x%p\\n",\n                    (h->default_ref_list[1][i].long_ref ? "LT" : "ST"),\n                    h->default_ref_list[1][i].pic_id,\n                    h->default_ref_list[1][i].f->data[0]);\n        }\n    }\n#endif\n    return 0;\n}']