From 58e0402e02ae5e466c33b9465c1465fdee68d342 Mon Sep 17 00:00:00 2001 From: Mika Raento Date: Mon, 1 Sep 2014 20:10:03 +0300 Subject: [PATCH] segment: don't access outside seg->frames array Fixes wrong number of segments output and undefined memory access. Signed-off-by: Michael Niedermayer --- libavformat/segment.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/segment.c b/libavformat/segment.c index ce784da225..1cb64543aa 100644 --- a/libavformat/segment.c +++ b/libavformat/segment.c @@ -684,7 +684,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 { if (seg->use_clocktime) {