X-Git-Url: https://git.piment-noir.org/?p=deb_ffmpeg.git;a=blobdiff_plain;f=ffmpeg%2Flibavformat%2Fmatroskadec.c;fp=ffmpeg%2Flibavformat%2Fmatroskadec.c;h=e9ba1e967e6ca567cac863f8c73054dbd43da85f;hp=c81b5a04af92409f43faca738d5f4fd03b58cc3b;hb=dcebb6f35d810c9009a455808b016c790bb633b4;hpb=f6fa7814ccfe3e76514b36cf04f5cd3cb657c8cf diff --git a/ffmpeg/libavformat/matroskadec.c b/ffmpeg/libavformat/matroskadec.c index c81b5a0..e9ba1e9 100644 --- a/ffmpeg/libavformat/matroskadec.c +++ b/ffmpeg/libavformat/matroskadec.c @@ -1414,13 +1414,17 @@ static void matroska_execute_seekhead(MatroskaDemuxContext *matroska) EbmlList *seekhead_list = &matroska->seekhead; int64_t before_pos = avio_tell(matroska->ctx->pb); int i; + int nb_elem; // we should not do any seeking in the streaming case if (!matroska->ctx->pb->seekable || (matroska->ctx->flags & AVFMT_FLAG_IGNIDX)) return; - for (i = 0; i < seekhead_list->nb_elem; i++) { + // do not read entries that are added while parsing seekhead entries + nb_elem = seekhead_list->nb_elem; + + for (i = 0; i < nb_elem; i++) { MatroskaSeekhead *seekhead = seekhead_list->elem; if (seekhead[i].pos <= before_pos) continue;