summaryrefslogtreecommitdiff
path: root/libavformat
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-06-18 20:50:15 +0200
committerMichael Niedermayer <michaelni@gmx.at>2013-06-18 22:53:00 +0200
commitf8ca8138f01d0a7d96d4e1ea65fecd1197f96206 (patch)
treefc90f822ecbac43e54befd97a9a63896c9b3325c /libavformat
parentb3dd50cd0dbbda08610b75384128f5f47f5199d9 (diff)
ff_gen_search: fix infinite loop
Fixes Ticket2639 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/utils.c2
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;