[FFmpeg-cvslog] avformat/mpegts: Ensure that mpegts_get_dts() only considers packets at or after the given position

Michael Niedermayer git at videolan.org
Wed Sep 4 01:14:35 CEST 2013


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Wed Sep  4 00:55:38 2013 +0200| [a66099192159d02b1a1c1820ddb24c7cea271a44] | committer: Michael Niedermayer

avformat/mpegts: Ensure that mpegts_get_dts() only considers packets at or after the given position

This fixes an infinite loop
An alternative fix would be to revert d73cbc22c5f2c305838d9867538cf4ad59c4035f
but that would worsen error resilience.

Found-by: Justin Ruggles
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

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

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

diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c
index c641794..2102bbe 100644
--- a/libavformat/mpegts.c
+++ b/libavformat/mpegts.c
@@ -2362,7 +2362,7 @@ static int64_t mpegts_get_dts(AVFormatContext *s, int stream_index,
         if(pkt.dts != AV_NOPTS_VALUE && pkt.pos >= 0){
             ff_reduce_index(s, pkt.stream_index);
             av_add_index_entry(s->streams[pkt.stream_index], pkt.pos, pkt.dts, 0, 0, AVINDEX_KEYFRAME /* FIXME keyframe? */);
-            if(pkt.stream_index == stream_index){
+            if(pkt.stream_index == stream_index && pkt.pos >= *ppos){
                 *ppos= pkt.pos;
                 return pkt.dts;
             }



More information about the ffmpeg-cvslog mailing list