[FFmpeg-cvslog] avformat/matroskadec: Fix cluster parsing loop which gathers seek information

Michael Niedermayer git at videolan.org
Wed Oct 22 14:38:47 CEST 2014


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Wed Oct 22 04:21:39 2014 +0200| [a39201818feab04c029f5b17bad2e7f40c1f2eab] | committer: Michael Niedermayer

avformat/matroskadec: Fix cluster parsing loop which gathers seek information

Fixes Ticket2263
Fixes Ticket3934

Reviewed-by: Rodger Combs <rodger.combs at gmail.com>
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

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

 libavformat/matroskadec.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c
index b742319..2ef3222 100644
--- a/libavformat/matroskadec.c
+++ b/libavformat/matroskadec.c
@@ -2921,11 +2921,11 @@ static int matroska_read_seek(AVFormatContext *s, int stream_index,
         goto err;
     timestamp = FFMAX(timestamp, st->index_entries[0].timestamp);
 
-    if ((index = av_index_search_timestamp(st, timestamp, flags)) < 0) {
+    if ((index = av_index_search_timestamp(st, timestamp, flags)) < 0 || index == st->nb_index_entries - 1) {
         avio_seek(s->pb, st->index_entries[st->nb_index_entries - 1].pos,
                   SEEK_SET);
         matroska->current_id = 0;
-        while ((index = av_index_search_timestamp(st, timestamp, flags)) < 0) {
+        while ((index = av_index_search_timestamp(st, timestamp, flags)) < 0 || index == st->nb_index_entries - 1) {
             matroska_clear_queue(matroska);
             if (matroska_parse_cluster(matroska) < 0)
                 break;



More information about the ffmpeg-cvslog mailing list