[FFmpeg-cvslog] segment: don't access outside seg->frames array
Mika Raento
git at videolan.org
Sat Sep 20 18:41:44 CEST 2014
ffmpeg | branch: release/2.2 | Mika Raento <mika.raento at elisa.fi> | Mon Sep 1 20:10:03 2014 +0300| [0484d7ad7ef7f4ce51525a95cc5b74d7e6c213a0] | committer: Michael Niedermayer
segment: don't access outside seg->frames array
Fixes wrong number of segments output and undefined memory access.
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
(cherry picked from commit 58e0402e02ae5e466c33b9465c1465fdee68d342)
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=0484d7ad7ef7f4ce51525a95cc5b74d7e6c213a0
---
libavformat/segment.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libavformat/segment.c b/libavformat/segment.c
index ad313a3..9b4b44f 100644
--- a/libavformat/segment.c
+++ b/libavformat/segment.c
@@ -666,7 +666,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);
More information about the ffmpeg-cvslog
mailing list