int av_packet_unpack_dictionary(const uint8_t *data, int size, AVDictionary **dict)

{

    const uint8_t *end = data + size;

    int ret = 0;



    if (!dict || !data || !size)

        return ret;

    if (size && end[-1])

        return AVERROR_INVALIDDATA;

    while (data < end) {

        const uint8_t *key = data;

        const uint8_t *val = data + strlen(key) + 1;



        if (val >= end)

            return AVERROR_INVALIDDATA;



        ret = av_dict_set(dict, key, val, 0);

        if (ret < 0)

            break;

        data = val + strlen(val) + 1;

    }



    return ret;

}

int av_packet_unpack_dictionary(const uint8_t *data, int size, AVDictionary **dict)

{

    const uint8_t *end = data + size;

    int ret = 0;



    if (!dict || !data || !size)

        return ret;

    if (size && end[-1])

        return AVERROR_INVALIDDATA;

    while (data < end) {

        const uint8_t *key = data;

        const uint8_t *val = data + strlen(key) + 1;



        if (val >= end)

            return AVERROR_INVALIDDATA;



        ret = av_dict_set(dict, key, val, 0);

        if (ret < 0)

            break;

        data = val + strlen(val) + 1;

    }



    return ret;

}

        if (val >= end)
int FUNC_0(const uint8_t *VAR_0, int VAR_1, AVDictionary **VAR_2)

{

    const uint8_t *VAR_3 = VAR_0 + VAR_1;

    int VAR_4 = 0;



    if (!VAR_2 || !VAR_0 || !VAR_1)

        return VAR_4;

    if (VAR_1 && VAR_3[-1])

        return AVERROR_INVALIDDATA;

    while (VAR_0 < VAR_3) {

        const uint8_t *VAR_5 = VAR_0;

        const uint8_t *VAR_6 = VAR_0 + strlen(VAR_5) + 1;



        if (VAR_6 >= VAR_3)

            return AVERROR_INVALIDDATA;



        VAR_4 = av_dict_set(VAR_2, VAR_5, VAR_6, 0);

        if (VAR_4 < 0)

            break;

        VAR_0 = VAR_6 + strlen(VAR_6) + 1;

    }



    return VAR_4;

}

int FUNC_0(const uint8_t *VAR_0, int VAR_1, AVDictionary **VAR_2)
{ const uint8_t *VAR_3 = VAR_0 + VAR_1; int VAR_4 = 0; if (!VAR_2 || !VAR_0 || !VAR_1)
return VAR_4; if (VAR_1 && VAR_3[-1])
return AVERROR_INVALIDDATA; while (VAR_0 < VAR_3) { const uint8_t *VAR_5 = VAR_0; const uint8_t *VAR_6 = VAR_0 + strlen(VAR_5) + 1; if (VAR_6 >= VAR_3)
return AVERROR_INVALIDDATA; VAR_4 = av_dict_set(VAR_2, VAR_5, VAR_6, 0); if (VAR_4 < 0)
break; VAR_0 = VAR_6 + strlen(VAR_6) + 1; } return VAR_4; }