comparison mov.c @ 1727:0d0826c53aec libavformat

add sanity checks
author bcoudurier
date Wed, 24 Jan 2007 10:44:24 +0000
parents 2a85c82b8538
children 5ed25b8bf482
comparison
equal deleted inserted replaced
1726:63bb140936c0 1727:0d0826c53aec
1617 1617
1618 mov->total_streams = s->nb_streams; 1618 mov->total_streams = s->nb_streams;
1619 1619
1620 for(i=0; i<mov->total_streams; i++) { 1620 for(i=0; i<mov->total_streams; i++) {
1621 MOVStreamContext *sc = mov->streams[i]; 1621 MOVStreamContext *sc = mov->streams[i];
1622 1622 /* sanity checks */
1623 if(!sc->stts_count || !sc->chunk_count || !sc->sample_to_chunk_sz ||
1624 (!sc->sample_size && !sc->sample_count)){
1625 av_log(s, AV_LOG_ERROR, "missing mandatory atoms, broken header\n");
1626 return -1;
1627 }
1623 if(!sc->time_rate) 1628 if(!sc->time_rate)
1624 sc->time_rate=1; 1629 sc->time_rate=1;
1625 if(!sc->time_scale) 1630 if(!sc->time_scale)
1626 sc->time_scale= mov->time_scale; 1631 sc->time_scale= mov->time_scale;
1627 av_set_pts_info(s->streams[i], 64, sc->time_rate, sc->time_scale); 1632 av_set_pts_info(s->streams[i], 64, sc->time_rate, sc->time_scale);