changeset 770:34e05913d999 libavformat

segfault fix
author michael
date Sat, 21 May 2005 10:25:58 +0000
parents 23570fc45b40
children 581bec6f0eb0
files mov.c
diffstat 1 files changed, 6 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/mov.c	Sat May 21 09:50:25 2005 +0000
+++ b/mov.c	Sat May 21 10:25:58 2005 +0000
@@ -772,10 +772,12 @@
     
     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
 /*