1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-08-15 14:13:16 +02:00

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>
This commit is contained in:
Mika Raento
2014-09-01 20:10:03 +03:00
committed by Michael Niedermayer
parent 35469835bb
commit 58e0402e02

View File

@@ -684,7 +684,7 @@ static int seg_write_packet(AVFormatContext *s, AVPacket *pkt)
end_pts = seg->segment_count < seg->nb_times ? end_pts = seg->segment_count < seg->nb_times ?
seg->times[seg->segment_count] : INT64_MAX; seg->times[seg->segment_count] : INT64_MAX;
} else if (seg->frames) { } 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; seg->frames[seg->segment_count] : INT_MAX;
} else { } else {
if (seg->use_clocktime) { if (seg->use_clocktime) {