static int mov_read_udta(MOVContext *c, ByteIOContext *pb, MOV_atom_t atom)

{

    uint64_t end = url_ftell(pb) + atom.size;



    while (url_ftell(pb) + 8 < end) {

        uint32_t tag_size = get_be32(pb);

        uint32_t tag      = get_le32(pb);

        uint64_t next     = url_ftell(pb) + tag_size - 8;



        if (next > end) // stop if tag_size is wrong

            break;



        switch (tag) {

        case MKTAG(0xa9,'n','a','m'):

            mov_parse_udta_string(pb, c->fc->title,     sizeof(c->fc->title));

            break;

        case MKTAG(0xa9,'w','r','t'):

            mov_parse_udta_string(pb, c->fc->author,    sizeof(c->fc->author));

            break;

        case MKTAG(0xa9,'c','p','y'):

            mov_parse_udta_string(pb, c->fc->copyright, sizeof(c->fc->copyright));

            break;

        case MKTAG(0xa9,'i','n','f'):

            mov_parse_udta_string(pb, c->fc->comment,   sizeof(c->fc->comment));

            break;

        default:

            break;

        }



        url_fseek(pb, next, SEEK_SET);

    }



    return 0;

}

static int mov_read_udta(MOVContext *c, ByteIOContext *pb, MOV_atom_t atom)

{

    uint64_t end = url_ftell(pb) + atom.size;



    while (url_ftell(pb) + 8 < end) {

        uint32_t tag_size = get_be32(pb);

        uint32_t tag      = get_le32(pb);

        uint64_t next     = url_ftell(pb) + tag_size - 8;



        if (next > end) 

            break;



        switch (tag) {

        case MKTAG(0xa9,'n','a','m'):

            mov_parse_udta_string(pb, c->fc->title,     sizeof(c->fc->title));

            break;

        case MKTAG(0xa9,'w','r','t'):

            mov_parse_udta_string(pb, c->fc->author,    sizeof(c->fc->author));

            break;

        case MKTAG(0xa9,'c','p','y'):

            mov_parse_udta_string(pb, c->fc->copyright, sizeof(c->fc->copyright));

            break;

        case MKTAG(0xa9,'i','n','f'):

            mov_parse_udta_string(pb, c->fc->comment,   sizeof(c->fc->comment));

            break;

        default:

            break;

        }



        url_fseek(pb, next, SEEK_SET);

    }



    return 0;

}

static int FUNC_0(MOVContext *VAR_0, ByteIOContext *VAR_1, MOV_atom_t VAR_2)

{

    uint64_t end = url_ftell(VAR_1) + VAR_2.size;



    while (url_ftell(VAR_1) + 8 < end) {

        uint32_t tag_size = get_be32(VAR_1);

        uint32_t tag      = get_le32(VAR_1);

        uint64_t next     = url_ftell(VAR_1) + tag_size - 8;



        if (next > end) 

            break;



        switch (tag) {

        case MKTAG(0xa9,'n','a','m'):

            mov_parse_udta_string(VAR_1, VAR_0->fc->title,     sizeof(VAR_0->fc->title));

            break;

        case MKTAG(0xa9,'w','r','t'):

            mov_parse_udta_string(VAR_1, VAR_0->fc->author,    sizeof(VAR_0->fc->author));

            break;

        case MKTAG(0xa9,'VAR_0','p','y'):

            mov_parse_udta_string(VAR_1, VAR_0->fc->copyright, sizeof(VAR_0->fc->copyright));

            break;

        case MKTAG(0xa9,'i','n','f'):

            mov_parse_udta_string(VAR_1, VAR_0->fc->comment,   sizeof(VAR_0->fc->comment));

            break;

        default:

            break;

        }



        url_fseek(VAR_1, next, SEEK_SET);

    }



    return 0;

}

static int FUNC_0(MOVContext *VAR_0, ByteIOContext *VAR_1, MOV_atom_t VAR_2)
{ uint64_t end = url_ftell(VAR_1) + VAR_2.size; while (url_ftell(VAR_1) + 8 < end) { uint32_t tag_size = get_be32(VAR_1); uint32_t tag      = get_le32(VAR_1); uint64_t next     = url_ftell(VAR_1) + tag_size - 8; if (next > end)
break; switch (tag) { case MKTAG(0xa9,'n','a','m'):
mov_parse_udta_string(VAR_1, VAR_0->fc->title,     sizeof(VAR_0->fc->title)); break; case MKTAG(0xa9,'w','r','t'):
mov_parse_udta_string(VAR_1, VAR_0->fc->author,    sizeof(VAR_0->fc->author)); break; case MKTAG(0xa9,'VAR_0','p','y'):
mov_parse_udta_string(VAR_1, VAR_0->fc->copyright, sizeof(VAR_0->fc->copyright)); break; case MKTAG(0xa9,'i','n','f'):
mov_parse_udta_string(VAR_1, VAR_0->fc->comment,   sizeof(VAR_0->fc->comment)); break; default:
break; } url_fseek(VAR_1, next, SEEK_SET); } return 0; }