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 58e0402e02)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Mika Raento 2014-09-01 20:10:03 +03:00 committed by Michael Niedermayer
parent 17f30ab6a1
commit cb10e05ff0
1 changed files with 1 additions and 1 deletions

View File

@ -646,7 +646,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);