[FFmpeg-cvslog] matroskadec: matroska_read_seek after after EBML_STOP leads to failure.

John Stebbins git at videolan.org
Tue Jul 26 00:53:23 CEST 2011


ffmpeg | branch: release/0.8 | John Stebbins <stebbins at jetheaddev.com> | Fri Jul  1 08:57:42 2011 -0700| [c29c609e0f4bf3fea29104c689c11f7dda499135] | committer: Reinhard Tartler

matroskadec: matroska_read_seek after after EBML_STOP leads to failure.

EBML_STOP leaves matroska->current_id set. Then matroska_read_seek changes
the stream position without resetting current_id.  The next
matroska_parse_cluster  fails due to calculation of incorrect pos.  So clear
current_id when avio_seek happens in matroska_read_seek.

Signed-off-by: Ronald S. Bultje <rsbultje at gmail.com>
(cherry picked from commit cdc2c1c57616956d975c57b4b69eb73865f513f5)

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

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

diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c
index 57a8f62..60f6c69 100644
--- a/libavformat/matroskadec.c
+++ b/libavformat/matroskadec.c
@@ -1903,6 +1903,7 @@ static int matroska_read_seek(AVFormatContext *s, int stream_index,
 
     if ((index = av_index_search_timestamp(st, timestamp, flags)) < 0) {
         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) {
             matroska_clear_queue(matroska);
             if (matroska_parse_cluster(matroska) < 0)
@@ -1931,6 +1932,7 @@ static int matroska_read_seek(AVFormatContext *s, int stream_index,
     }
 
     avio_seek(s->pb, st->index_entries[index_min].pos, SEEK_SET);
+    matroska->current_id = 0;
     matroska->skip_to_keyframe = !(flags & AVSEEK_FLAG_ANY);
     matroska->skip_to_timecode = st->index_entries[index].timestamp;
     matroska->done = 0;



More information about the ffmpeg-cvslog mailing list