If one isn't in a cluster initially, matroska_parse_cluster would test whether the next element is a cluster. Said test can fail and if it failed, the error would be returned until 71c90881. But 71c90881 changed this inadvertently: If the element found is an unknown-length element that is intended to be skipped, but can't (because of its unknown length), it is entered and if an error happens during parsing its children, it is possible that one is on level 2 after the initial test. This will then be treated as if one were inside a cluster and an attempt is made to parse SimpleBlocks/BlockGroups in which case the original error will be overwritten and overlooked. This commit fixes this.
Signed-off-by: Andreas Rheinhardt <andreas.rheinha...@gmail.com> --- libavformat/matroskadec.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c index 8c4ff30935..0c881a67e8 100644 --- a/libavformat/matroskadec.c +++ b/libavformat/matroskadec.c @@ -3686,9 +3686,9 @@ static int matroska_parse_cluster(MatroskaDemuxContext *matroska) cluster->pos = avio_tell(matroska->ctx->pb) - 4; res = ebml_parse(matroska, matroska_cluster_enter, cluster); - if (res < 0) - return res; } + if (res < 0) + return res; } if (matroska->num_levels == 2) { -- 2.21.0 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".