diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-06-18 22:50:15 +0400 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-06-19 00:53:00 +0400 |
commit | f8ca8138f01d0a7d96d4e1ea65fecd1197f96206 (patch) | |
tree | fc90f822ecbac43e54befd97a9a63896c9b3325c | |
parent | b3dd50cd0dbbda08610b75384128f5f47f5199d9 (diff) |
ff_gen_search: fix infinite loop
Fixes Ticket2639
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavformat/utils.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c index 686374d92a..ce92af6409 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -1778,7 +1778,7 @@ int64_t ff_gen_search(AVFormatContext *s, int stream_index, int64_t target_ts, pos_max = FFMAX(0, pos_max - step); ts_max = ff_read_timestamp(s, stream_index, &pos_max, limit, read_timestamp); step += step; - }while(ts_max == AV_NOPTS_VALUE && pos_max > 0); + }while(ts_max == AV_NOPTS_VALUE && 2*limit > step); if (ts_max == AV_NOPTS_VALUE) return -1; |