static int mxf_read_primer_pack(MXFContext *mxf)
{
    ByteIOContext *pb = mxf->fc->pb;
    int item_num = get_be32(pb);
    int item_len = get_be32(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;
    get_buffer(pb, mxf->local_tags, item_num*item_len);
    return 0;
}
['static int mxf_read_primer_pack(MXFContext *mxf)\n{\n    ByteIOContext *pb = mxf->fc->pb;\n    int item_num = get_be32(pb);\n    int item_len = get_be32(pb);\n    if (item_len != 18) {\n        av_log(mxf->fc, AV_LOG_ERROR, "unsupported primer pack item length\\n");\n        return -1;\n    }\n    if (item_num > UINT_MAX / item_len)\n        return -1;\n    mxf->local_tags_count = item_num;\n    mxf->local_tags = av_malloc(item_num*item_len);\n    if (!mxf->local_tags)\n        return -1;\n    get_buffer(pb, mxf->local_tags, item_num*item_len);\n    return 0;\n}', 'unsigned int get_be32(ByteIOContext *s)\n{\n    unsigned int val;\n    val = get_be16(s) << 16;\n    val |= get_be16(s);\n    return val;\n}', 'unsigned int get_be16(ByteIOContext *s)\n{\n    unsigned int val;\n    val = get_byte(s) << 8;\n    val |= get_byte(s);\n    return val;\n}', 'int get_byte(ByteIOContext *s)\n{\n    if (s->buf_ptr < s->buf_end) {\n        return *s->buf_ptr++;\n    } else {\n        fill_buffer(s);\n        if (s->buf_ptr < s->buf_end)\n            return *s->buf_ptr++;\n        else\n            return 0;\n    }\n}']