[FFmpeg-cvslog] ff_gen_search: fix infinite loop

Michael Niedermayer git at videolan.org
Tue Jun 18 23:56:49 CEST 2013


ffmpeg | branch: release/1.2 | Michael Niedermayer <michaelni at gmx.at> | Tue Jun 18 20:50:15 2013 +0200| [c0445df5b35947cf40abcb15ce6b39e404e20799] | committer: Carl Eugen Hoyos

ff_gen_search: fix infinite loop

Fixes Ticket2639

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
(cherry picked from commit f8ca8138f01d0a7d96d4e1ea65fecd1197f96206)

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

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

diff --git a/libavformat/utils.c b/libavformat/utils.c
index d9c95cf..ed83f28 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -1868,7 +1868,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;
 



More information about the ffmpeg-cvslog mailing list