mirror of https://git.ffmpeg.org/ffmpeg.git
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:
parent
17f30ab6a1
commit
cb10e05ff0
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue