int64_t first= sc2->chunk_offsets[0]; int64_t last= sc2->chunk_offsets[sc2->chunk_count-1]; if(first >= sc->chunk_offsets[entries-1] || last <= sc->chunk_offsets[0]) c->ni=1;
if(sc2 && sc2->chunk_offsets){ int64_t first= sc2->chunk_offsets[0]; int64_t last= sc2->chunk_offsets[sc2->chunk_count-1]; if(first >= sc->chunk_offsets[entries-1] || last <= sc->chunk_offsets[0]) c->ni=1; }
static int mov_read_stco(MOVContext *c, ByteIOContext *pb, MOV_atom_t atom){    AVStream *st = c->fc->streams[c->fc->nb_streams-1];    MOVStreamContext *sc = (MOVStreamContext *)st->priv_data;    unsigned int i, entries;    print_atom("stco", atom);    get_byte(pb); /* version */    get_byte(pb); get_byte(pb); get_byte(pb); /* flags */    entries = get_be32(pb);            if(entries >= UINT_MAX/sizeof(int64_t))        return -1;     sc->chunk_count = entries;    sc->chunk_offsets = (int64_t*) av_malloc(entries * sizeof(int64_t));    if (!sc->chunk_offsets)        return -1;    if (atom.type == MKTAG('s', 't', 'c', 'o')) {        for(i=0; i<entries; i++) {            sc->chunk_offsets[i] = get_be32(pb);        }    } else if (atom.type == MKTAG('c', 'o', '6', '4')) {        for(i=0; i<entries; i++) {            sc->chunk_offsets[i] = get_be64(pb);        }    } else        return -1;        for(i=0; i<c->fc->nb_streams; i++){        MOVStreamContext *sc2 = (MOVStreamContext *)c->fc->streams[i]->priv_data;        int64_t first= sc2->chunk_offsets[0];        int64_t last= sc2->chunk_offsets[sc2->chunk_count-1];        if(first >= sc->chunk_offsets[entries-1] || last <= sc->chunk_offsets[0])            c->ni=1;    }#ifdef DEBUG/*    for(i=0; i<entries; i++) {        av_log(NULL, AV_LOG_DEBUG, "chunk offset=0x%Lx\n", sc->chunk_offsets[i]);    }*/#endif    return 0;}