aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBaptiste Coudurier <baptiste.coudurier@gmail.com>2007-01-24 10:44:24 +0000
committerBaptiste Coudurier <baptiste.coudurier@gmail.com>2007-01-24 10:44:24 +0000
commitdfcf8d57c59428ba1a9f5a65c4c75d2f84661cf5 (patch)
tree1277e6dc741084c99d6f2cdfd27a188e29d3de85
parent3e997aa4253d14f498a765a7d19e812696646051 (diff)
downloadffmpeg-dfcf8d57c59428ba1a9f5a65c4c75d2f84661cf5.tar.gz
add sanity checks
Originally committed as revision 7679 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r--libavformat/mov.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/libavformat/mov.c b/libavformat/mov.c
index 74fc0ef326..45981f4751 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -1619,7 +1619,12 @@ static int mov_read_header(AVFormatContext *s, AVFormatParameters *ap)
for(i=0; i<mov->total_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)