static int mov_read_stps(MOVContext *c, AVIOContext *pb, MOVAtom atom)

{

    AVStream *st;

    MOVStreamContext *sc;

    unsigned i, entries;



    if (c->fc->nb_streams < 1)

        return 0;

    st = c->fc->streams[c->fc->nb_streams-1];

    sc = st->priv_data;



    avio_rb32(pb); // version + flags



    entries = avio_rb32(pb);

    if (entries >= UINT_MAX / sizeof(*sc->stps_data))

        return AVERROR_INVALIDDATA;

    sc->stps_data = av_malloc(entries * sizeof(*sc->stps_data));

    if (!sc->stps_data)

        return AVERROR(ENOMEM);

    sc->stps_count = entries;



    for (i = 0; i < entries; i++) {

        sc->stps_data[i] = avio_rb32(pb);

        //av_dlog(c->fc, "stps %d\n", sc->stps_data[i]);

    }



    return 0;

}

static int mov_read_stps(MOVContext *c, AVIOContext *pb, MOVAtom atom)

{

    AVStream *st;

    MOVStreamContext *sc;

    unsigned i, entries;



    if (c->fc->nb_streams < 1)

        return 0;

    st = c->fc->streams[c->fc->nb_streams-1];

    sc = st->priv_data;



    avio_rb32(pb); 



    entries = avio_rb32(pb);

    if (entries >= UINT_MAX / sizeof(*sc->stps_data))

        return AVERROR_INVALIDDATA;

    sc->stps_data = av_malloc(entries * sizeof(*sc->stps_data));

    if (!sc->stps_data)

        return AVERROR(ENOMEM);

    sc->stps_count = entries;



    for (i = 0; i < entries; i++) {

        sc->stps_data[i] = avio_rb32(pb);

        

    }



    return 0;

}

static int FUNC_0(MOVContext *VAR_0, AVIOContext *VAR_1, MOVAtom VAR_2)

{

    AVStream *st;

    MOVStreamContext *sc;

    unsigned VAR_3, VAR_4;



    if (VAR_0->fc->nb_streams < 1)

        return 0;

    st = VAR_0->fc->streams[VAR_0->fc->nb_streams-1];

    sc = st->priv_data;



    avio_rb32(VAR_1); 



    VAR_4 = avio_rb32(VAR_1);

    if (VAR_4 >= UINT_MAX / sizeof(*sc->stps_data))

        return AVERROR_INVALIDDATA;

    sc->stps_data = av_malloc(VAR_4 * sizeof(*sc->stps_data));

    if (!sc->stps_data)

        return AVERROR(ENOMEM);

    sc->stps_count = VAR_4;



    for (VAR_3 = 0; VAR_3 < VAR_4; VAR_3++) {

        sc->stps_data[VAR_3] = avio_rb32(VAR_1);

        

    }



    return 0;

}

static int FUNC_0(MOVContext *VAR_0, AVIOContext *VAR_1, MOVAtom VAR_2)
{ AVStream *st; MOVStreamContext *sc; unsigned VAR_3, VAR_4; if (VAR_0->fc->nb_streams < 1)
return 0; st = VAR_0->fc->streams[VAR_0->fc->nb_streams-1]; sc = st->priv_data; avio_rb32(VAR_1); VAR_4 = avio_rb32(VAR_1); if (VAR_4 >= UINT_MAX / sizeof(*sc->stps_data))
return AVERROR_INVALIDDATA; sc->stps_data = av_malloc(VAR_4 * sizeof(*sc->stps_data)); if (!sc->stps_data)
return AVERROR(ENOMEM); sc->stps_count = VAR_4; for (VAR_3 = 0; VAR_3 < VAR_4; VAR_3++) { sc->stps_data[VAR_3] = avio_rb32(VAR_1); } return 0; }