[FFmpeg-cvslog] avformat/utils: assert position monotonicity in ff_find_last_ts()

Michael Niedermayer git at videolan.org
Wed Sep 4 01:49:06 CEST 2013


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Wed Sep  4 00:58:16 2013 +0200| [e5c338ba7abd086b54021da885dc3b451927f4d5] | committer: Michael Niedermayer

avformat/utils: assert position monotonicity in ff_find_last_ts()

This ensures that no read timestamp functions finds packets before the search window in ff_find_last_ts()
which could cause an infinite loop

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

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

 libavformat/utils.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/libavformat/utils.c b/libavformat/utils.c
index 277b559..763588b 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -1779,6 +1779,7 @@ int ff_find_last_ts(AVFormatContext *s, int stream_index, int64_t *ts, int64_t *
         int64_t tmp_ts = ff_read_timestamp(s, stream_index, &tmp_pos, INT64_MAX, read_timestamp);
         if(tmp_ts == AV_NOPTS_VALUE)
             break;
+        av_assert0(tmp_pos > pos_max);
         ts_max  = tmp_ts;
         pos_max = tmp_pos;
         if(tmp_pos >= filesize)



More information about the ffmpeg-cvslog mailing list