diff options
author | Mika Raento <mika.raento@elisa.fi> | 2014-09-01 20:10:03 +0300 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-10-03 03:40:58 +0200 |
commit | 8df77c37584a01bcd8ac90ed4fe4d51856935cf4 (patch) | |
tree | d148b2e7c7f892cfe04047091a62ef61bde62af2 | |
parent | 08f56b846c23889e0a47f94d06baa3114a121b4b (diff) | |
download | ffmpeg-8df77c37584a01bcd8ac90ed4fe4d51856935cf4.tar.gz |
segment: don't access outside seg->frames array
Fixes wrong number of segments output and undefined memory access.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 58e0402e02ae5e466c33b9465c1465fdee68d342)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavformat/segment.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/segment.c b/libavformat/segment.c index f8227d149e..b627cd7e3c 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) { |