movenc: Check that frag_info entries exist in mov_write_sidx_tag
[ffmpeg.git] / libavformat / movenc.c
index 158dfa8..a19c64b 100644 (file)
@@ -2751,6 +2751,8 @@ static int mov_write_sidx_tag(AVIOContext *pb,
         }
     } else {
         entries = track->nb_frag_info;
+        if (entries <= 0)
+            return 0;
         presentation_time = track->frag_info[0].time;
     }