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

Mika Raento git at videolan.org
Fri Oct 3 03:47:45 CEST 2014


ffmpeg | branch: release/2.3 | Mika Raento <mika.raento at elisa.fi> | Mon Sep  1 20:10:03 2014 +0300| [8df77c37584a01bcd8ac90ed4fe4d51856935cf4] | 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=8df77c37584a01bcd8ac90ed4fe4d51856935cf4
---

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

diff --git a/libavformat/segment.c b/libavformat/segment.c
index f8227d1..b627cd7 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