static int mxf_read_primer_pack(void *arg, AVIOContext *pb, int tag, int size, UID uid)

{

    MXFContext *mxf = arg;

    int item_num = avio_rb32(pb);

    int item_len = avio_rb32(pb);



    if (item_len != 18) {

        av_log(mxf->fc, AV_LOG_ERROR, "unsupported primer pack item length\n");

        return -1;

    }

    if (item_num > UINT_MAX / item_len)

        return -1;

    mxf->local_tags_count = item_num;

    mxf->local_tags = av_malloc(item_num*item_len);

    if (!mxf->local_tags)

        return -1;

    avio_read(pb, mxf->local_tags, item_num*item_len);

    return 0;

}

static int mxf_read_primer_pack(void *arg, AVIOContext *pb, int tag, int size, UID uid)

{

    MXFContext *mxf = arg;

    int item_num = avio_rb32(pb);

    int item_len = avio_rb32(pb);



    if (item_len != 18) {

        av_log(mxf->fc, AV_LOG_ERROR, "unsupported primer pack item length\n");

        return -1;

    }

    if (item_num > UINT_MAX / item_len)

        return -1;

    mxf->local_tags_count = item_num;

    mxf->local_tags = av_malloc(item_num*item_len);

    if (!mxf->local_tags)

        return -1;

    avio_read(pb, mxf->local_tags, item_num*item_len);

    return 0;

}

static int mxf_read_primer_pack(void *arg, AVIOContext *pb, int tag, int size, UID uid)
static int FUNC_0(void *VAR_0, AVIOContext *VAR_1, int VAR_2, int VAR_3, UID VAR_4)

{

    MXFContext *mxf = VAR_0;

    int VAR_5 = avio_rb32(VAR_1);

    int VAR_6 = avio_rb32(VAR_1);



    if (VAR_6 != 18) {

        av_log(mxf->fc, AV_LOG_ERROR, "unsupported primer pack item length\n");

        return -1;

    }

    if (VAR_5 > UINT_MAX / VAR_6)

        return -1;

    mxf->local_tags_count = VAR_5;

    mxf->local_tags = av_malloc(VAR_5*VAR_6);

    if (!mxf->local_tags)

        return -1;

    avio_read(VAR_1, mxf->local_tags, VAR_5*VAR_6);

    return 0;

}

static int FUNC_0(void *VAR_0, AVIOContext *VAR_1, int VAR_2, int VAR_3, UID VAR_4)
{ MXFContext *mxf = VAR_0; int VAR_5 = avio_rb32(VAR_1); int VAR_6 = avio_rb32(VAR_1); if (VAR_6 != 18) { av_log(mxf->fc, AV_LOG_ERROR, "unsupported primer pack item length\n"); return -1; } if (VAR_5 > UINT_MAX / VAR_6)
return -1; mxf->local_tags_count = VAR_5; mxf->local_tags = av_malloc(VAR_5*VAR_6); if (!mxf->local_tags)
return -1; avio_read(VAR_1, mxf->local_tags, VAR_5*VAR_6); return 0; }