diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2005-05-21 10:25:58 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2005-05-21 10:25:58 +0000 |
commit | 45139adf30cbd487560efa0e5efe104db46960db (patch) | |
tree | e3d9466b849a89b421a72c561482cafd2ce85f47 | |
parent | 86d8602f626c403071ededb088a7359cd012e6b2 (diff) | |
download | ffmpeg-45139adf30cbd487560efa0e5efe104db46960db.tar.gz |
segfault fix
Originally committed as revision 4295 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r-- | libavformat/mov.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/libavformat/mov.c b/libavformat/mov.c index 1bbbf7fdf6..e1a41b10a8 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -772,10 +772,12 @@ static int mov_read_stco(MOVContext *c, ByteIOContext *pb, MOV_atom_t atom) 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; + 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; + } } #ifdef DEBUG /* |