static int mov_read_ctts(MOVContext *c, ByteIOContext *pb, MOV_atom_t atom)
{
    AVStream *st = c->fc->streams[c->fc->nb_streams-1];
    MOVStreamContext *sc = st->priv_data;
    unsigned int i, entries;
    get_byte(pb);
    get_be24(pb);
    entries = get_be32(pb);
    if(entries >= UINT_MAX / sizeof(MOV_stts_t))
        return -1;
    sc->ctts_count = entries;
    sc->ctts_data = av_malloc(entries * sizeof(MOV_stts_t));
    if (!sc->ctts_data)
        return -1;
    dprintf(c->fc, "track[%i].ctts.entries = %i\n", c->fc->nb_streams-1, entries);
    for(i=0; i<entries; i++) {
        int count    =get_be32(pb);
        int duration =get_be32(pb);
        if (duration < 0) {
            av_log(c->fc, AV_LOG_ERROR, "negative ctts, ignoring\n");
            sc->ctts_count = 0;
            url_fskip(pb, 8 * (entries - i - 1));
            break;
        }
        sc->ctts_data[i].count   = count;
        sc->ctts_data[i].duration= duration;
        sc->time_rate= ff_gcd(sc->time_rate, duration);
    }
    return 0;
}
['static int mov_read_ctts(MOVContext *c, ByteIOContext *pb, MOV_atom_t atom)\n{\n    AVStream *st = c->fc->streams[c->fc->nb_streams-1];\n    MOVStreamContext *sc = st->priv_data;\n    unsigned int i, entries;\n    get_byte(pb);\n    get_be24(pb);\n    entries = get_be32(pb);\n    if(entries >= UINT_MAX / sizeof(MOV_stts_t))\n        return -1;\n    sc->ctts_count = entries;\n    sc->ctts_data = av_malloc(entries * sizeof(MOV_stts_t));\n    if (!sc->ctts_data)\n        return -1;\n    dprintf(c->fc, "track[%i].ctts.entries = %i\\n", c->fc->nb_streams-1, entries);\n    for(i=0; i<entries; i++) {\n        int count    =get_be32(pb);\n        int duration =get_be32(pb);\n        if (duration < 0) {\n            av_log(c->fc, AV_LOG_ERROR, "negative ctts, ignoring\\n");\n            sc->ctts_count = 0;\n            url_fskip(pb, 8 * (entries - i - 1));\n            break;\n        }\n        sc->ctts_data[i].count   = count;\n        sc->ctts_data[i].duration= duration;\n        sc->time_rate= ff_gcd(sc->time_rate, duration);\n    }\n    return 0;\n}']