summaryrefslogtreecommitdiff
path: root/libavformat/matroskadec.c
diff options
context:
space:
mode:
authorJohn Stebbins <stebbins@jetheaddev.com>2011-07-01 08:57:42 -0700
committerRonald S. Bultje <rsbultje@gmail.com>2011-07-01 08:59:26 -0700
commitcdc2c1c57616956d975c57b4b69eb73865f513f5 (patch)
treeb7a2142d047fb1e8a36f28c8d60de2c131977b6a /libavformat/matroskadec.c
parent134557f3a47697a7b5e5da2bd7e5a4b8f8d56b1c (diff)
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@gmail.com>
Diffstat (limited to 'libavformat/matroskadec.c')
-rw-r--r--libavformat/matroskadec.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c
index c5f8e673dc..a1e827f093 100644
--- a/libavformat/matroskadec.c
+++ b/libavformat/matroskadec.c
@@ -1904,6 +1904,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)
@@ -1932,6 +1933,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;