static int avi_read_tag(AVFormatContext *s, AVStream *st, uint32_t tag, uint32_t size)

{

    AVIOContext *pb = s->pb;

    char key[5] = {0}, *value;



    size += (size & 1);



    if (size == UINT_MAX)

        return -1;

    value = av_malloc(size+1);

    if (!value)

        return -1;

    avio_read(pb, value, size);

    value[size]=0;



    AV_WL32(key, tag);



    return av_dict_set(st ? &st->metadata : &s->metadata, key, value,

                            AV_DICT_DONT_STRDUP_VAL);

}

static int avi_read_tag(AVFormatContext *s, AVStream *st, uint32_t tag, uint32_t size)

{

    AVIOContext *pb = s->pb;

    char key[5] = {0}, *value;



    size += (size & 1);



    if (size == UINT_MAX)

        return -1;

    value = av_malloc(size+1);

    if (!value)

        return -1;

    avio_read(pb, value, size);

    value[size]=0;



    AV_WL32(key, tag);



    return av_dict_set(st ? &st->metadata : &s->metadata, key, value,

                            AV_DICT_DONT_STRDUP_VAL);

}

static int FUNC_0(AVFormatContext *VAR_0, AVStream *VAR_1, uint32_t VAR_2, uint32_t VAR_3)

{

    AVIOContext *pb = VAR_0->pb;

    char VAR_4[5] = {0}, *VAR_5;



    VAR_3 += (VAR_3 & 1);



    if (VAR_3 == UINT_MAX)

        return -1;

    VAR_5 = av_malloc(VAR_3+1);

    if (!VAR_5)

        return -1;

    avio_read(pb, VAR_5, VAR_3);

    VAR_5[VAR_3]=0;



    AV_WL32(VAR_4, VAR_2);



    return av_dict_set(VAR_1 ? &VAR_1->metadata : &VAR_0->metadata, VAR_4, VAR_5,

                            AV_DICT_DONT_STRDUP_VAL);

}

static int FUNC_0(AVFormatContext *VAR_0, AVStream *VAR_1, uint32_t VAR_2, uint32_t VAR_3)
{ AVIOContext *pb = VAR_0->pb; char VAR_4[5] = {0}, *VAR_5; VAR_3 += (VAR_3 & 1); if (VAR_3 == UINT_MAX)
return -1; VAR_5 = av_malloc(VAR_3+1); if (!VAR_5)
return -1; avio_read(pb, VAR_5, VAR_3); VAR_5[VAR_3]=0; AV_WL32(VAR_4, VAR_2); return av_dict_set(VAR_1 ? &VAR_1->metadata : &VAR_0->metadata, VAR_4, VAR_5,
AV_DICT_DONT_STRDUP_VAL); }