# HG changeset patch # User bcoudurier # Date 1169635464 0 # Node ID 0d0826c53aecee7886464e1fbaf24b261b547c3d # Parent 63bb140936c0121985d33a2f3135f5ec8fdefaf0 add sanity checks diff -r 63bb140936c0 -r 0d0826c53aec mov.c --- a/mov.c Tue Jan 23 21:47:32 2007 +0000 +++ b/mov.c Wed Jan 24 10:44:24 2007 +0000 @@ -1619,7 +1619,12 @@ for(i=0; itotal_streams; i++) { MOVStreamContext *sc = mov->streams[i]; - + /* sanity checks */ + if(!sc->stts_count || !sc->chunk_count || !sc->sample_to_chunk_sz || + (!sc->sample_size && !sc->sample_count)){ + av_log(s, AV_LOG_ERROR, "missing mandatory atoms, broken header\n"); + return -1; + } if(!sc->time_rate) sc->time_rate=1; if(!sc->time_scale)