[FFmpeg-cvslog] segment: don't access outside seg->frames array

Mika Raento git at videolan.org
Tue Sep 2 11:43:16 CEST 2014


ffmpeg | branch: master | Mika Raento <mika.raento at elisa.fi> | Mon Sep  1 20:10:03 2014 +0300| [58e0402e02ae5e466c33b9465c1465fdee68d342] | 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>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=58e0402e02ae5e466c33b9465c1465fdee68d342
---

 libavformat/segment.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/segment.c b/libavformat/segment.c
index ce784da..1cb6454 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) {



More information about the ffmpeg-cvslog mailing list