aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMika Raento <mika.raento@elisa.fi>2014-09-01 20:10:03 +0300
committerMichael Niedermayer <michaelni@gmx.at>2014-10-03 03:40:58 +0200
commit8df77c37584a01bcd8ac90ed4fe4d51856935cf4 (patch)
treed148b2e7c7f892cfe04047091a62ef61bde62af2
parent08f56b846c23889e0a47f94d06baa3114a121b4b (diff)
downloadffmpeg-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.c2
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) {