libavcodec/extract_extradata_bsf.c:125: error: Uninitialized Value
  The value read from filtered_buf was never initialized.

libavcodec/extract_extradata_bsf.c:125:13: 
123.         if (s->remove) {
124.             av_buffer_unref(&pkt->buf);
125.             pkt->buf  = filtered_buf;
                 ^
126.             pkt->data = filtered_buf->data;
127.             pkt->size = filtered_data - filtered_buf->data;

static int extract_extradata_h2645(AVBSFContext *ctx, AVPacket *pkt,
                                   uint8_t **data, int *size)
{
    static const int extradata_nal_types_hevc[] = {
        HEVC_NAL_VPS, HEVC_NAL_SPS, HEVC_NAL_PPS,
    };
    static const int extradata_nal_types_h264[] = {
        H264_NAL_SPS, H264_NAL_PPS,
    };
    ExtractExtradataContext *s = ctx->priv_data;
    H2645Packet h2645_pkt = { 0 };
    int extradata_size = 0;
    const int *extradata_nal_types;
    int nb_extradata_nal_types;
    int i, ret = 0;
    if (ctx->par_in->codec_id == AV_CODEC_ID_HEVC) {
        extradata_nal_types    = extradata_nal_types_hevc;
        nb_extradata_nal_types = FF_ARRAY_ELEMS(extradata_nal_types_hevc);
    } else {
        extradata_nal_types    = extradata_nal_types_h264;
        nb_extradata_nal_types = FF_ARRAY_ELEMS(extradata_nal_types_h264);
    }
    ret = ff_h2645_packet_split(&h2645_pkt, pkt->data, pkt->size,
                                ctx, 0, 0, ctx->par_in->codec_id);
    if (ret < 0)
        return ret;
    for (i = 0; i < h2645_pkt.nb_nals; i++) {
        H2645NAL *nal = &h2645_pkt.nals[i];
        if (val_in_array(extradata_nal_types, nb_extradata_nal_types, nal->type))
            extradata_size += nal->raw_size + 3;
    }
    if (extradata_size) {
        AVBufferRef *filtered_buf;
        uint8_t *extradata, *filtered_data;
        if (s->remove) {
            filtered_buf = av_buffer_alloc(pkt->size + AV_INPUT_BUFFER_PADDING_SIZE);
            if (!filtered_buf)
                goto fail;
            filtered_data = filtered_buf->data;
        }
        extradata = av_malloc(extradata_size + AV_INPUT_BUFFER_PADDING_SIZE);
        if (!extradata) {
            av_buffer_unref(&filtered_buf);
            goto fail;
        }
        *data = extradata;
        *size = extradata_size;
        for (i = 0; i < h2645_pkt.nb_nals; i++) {
            H2645NAL *nal = &h2645_pkt.nals[i];
            if (val_in_array(extradata_nal_types, nb_extradata_nal_types,
                             nal->type)) {
                AV_WB24(extradata, 1);
                memcpy(extradata + 3, nal->raw_data, nal->raw_size);
                extradata += 3 + nal->raw_size;
            } else if (s->remove) {
                AV_WB24(filtered_data, 1);
                memcpy(filtered_data + 3, nal->raw_data, nal->raw_size);
                filtered_data += 3 + nal->raw_size;
            }
        }
        if (s->remove) {
            av_buffer_unref(&pkt->buf);
            pkt->buf  = filtered_buf;
            pkt->data = filtered_buf->data;
            pkt->size = filtered_data - filtered_buf->data;
        }
    }
fail:
    ff_h2645_packet_uninit(&h2645_pkt);
    return ret;
}
['static int extract_extradata_h2645(AVBSFContext *ctx, AVPacket *pkt,\n                                   uint8_t **data, int *size)\n{\n    static const int extradata_nal_types_hevc[] = {\n        HEVC_NAL_VPS, HEVC_NAL_SPS, HEVC_NAL_PPS,\n    };\n    static const int extradata_nal_types_h264[] = {\n        H264_NAL_SPS, H264_NAL_PPS,\n    };\n    ExtractExtradataContext *s = ctx->priv_data;\n    H2645Packet h2645_pkt = { 0 };\n    int extradata_size = 0;\n    const int *extradata_nal_types;\n    int nb_extradata_nal_types;\n    int i, ret = 0;\n    if (ctx->par_in->codec_id == AV_CODEC_ID_HEVC) {\n        extradata_nal_types    = extradata_nal_types_hevc;\n        nb_extradata_nal_types = FF_ARRAY_ELEMS(extradata_nal_types_hevc);\n    } else {\n        extradata_nal_types    = extradata_nal_types_h264;\n        nb_extradata_nal_types = FF_ARRAY_ELEMS(extradata_nal_types_h264);\n    }\n    ret = ff_h2645_packet_split(&h2645_pkt, pkt->data, pkt->size,\n                                ctx, 0, 0, ctx->par_in->codec_id);\n    if (ret < 0)\n        return ret;\n    for (i = 0; i < h2645_pkt.nb_nals; i++) {\n        H2645NAL *nal = &h2645_pkt.nals[i];\n        if (val_in_array(extradata_nal_types, nb_extradata_nal_types, nal->type))\n            extradata_size += nal->raw_size + 3;\n    }\n    if (extradata_size) {\n        AVBufferRef *filtered_buf;\n        uint8_t *extradata, *filtered_data;\n        if (s->remove) {\n            filtered_buf = av_buffer_alloc(pkt->size + AV_INPUT_BUFFER_PADDING_SIZE);\n            if (!filtered_buf)\n                goto fail;\n            filtered_data = filtered_buf->data;\n        }\n        extradata = av_malloc(extradata_size + AV_INPUT_BUFFER_PADDING_SIZE);\n        if (!extradata) {\n            av_buffer_unref(&filtered_buf);\n            goto fail;\n        }\n        *data = extradata;\n        *size = extradata_size;\n        for (i = 0; i < h2645_pkt.nb_nals; i++) {\n            H2645NAL *nal = &h2645_pkt.nals[i];\n            if (val_in_array(extradata_nal_types, nb_extradata_nal_types,\n                             nal->type)) {\n                AV_WB24(extradata, 1);\n                memcpy(extradata + 3, nal->raw_data, nal->raw_size);\n                extradata += 3 + nal->raw_size;\n            } else if (s->remove) {\n                AV_WB24(filtered_data, 1);\n                memcpy(filtered_data + 3, nal->raw_data, nal->raw_size);\n                filtered_data += 3 + nal->raw_size;\n            }\n        }\n        if (s->remove) {\n            av_buffer_unref(&pkt->buf);\n            pkt->buf  = filtered_buf;\n            pkt->data = filtered_buf->data;\n            pkt->size = filtered_data - filtered_buf->data;\n        }\n    }\nfail:\n    ff_h2645_packet_uninit(&h2645_pkt);\n    return ret;\n}']