segment: don't access outside seg->frames array
[ffmpeg.git] / libavformat / segment.c
index ad313a3..9b4b44f 100644 (file)
@@ -666,7 +666,7 @@ static int seg_write_packet(AVFormatContext *s, AVPacket *pkt)
         end_pts = seg->segment_count < seg->nb_times ?
             seg->times[seg->segment_count] : INT64_MAX;
     } else if (seg->frames) {
-        start_frame = seg->segment_count <= seg->nb_frames ?
+        start_frame = seg->segment_count < seg->nb_frames ?
             seg->frames[seg->segment_count] : INT_MAX;
     } else {
         end_pts = seg->time * (seg->segment_count+1);