diff options
author | Aurelien Jacobs <aurel@gnuage.org> | 2010-06-11 20:43:47 +0400 |
---|---|---|
committer | Aurelien Jacobs <aurel@gnuage.org> | 2010-06-11 20:43:47 +0400 |
commit | 8dbe48fccb9be18fff0b42dc3dfc85ea50ed2a3c (patch) | |
tree | 3cfb26f146846fb52f38c386d65b1e2a503311c6 /libavformat/matroskadec.c | |
parent | 80702035d2e7c9911a852daa5dbc65c4fa1d62a2 (diff) |
matroskadec: add support for live broadcast containing unknown size clusters
This interrupt parsing and goes one ebml level up when encountering
a cluster start inside an unknown sized element which is not supposed to
contain a cluster.
fix issue1991
Originally committed as revision 23589 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/matroskadec.c')
-rw-r--r-- | libavformat/matroskadec.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c index e6c3fc78b1..a486d249f2 100644 --- a/libavformat/matroskadec.c +++ b/libavformat/matroskadec.c @@ -518,7 +518,7 @@ static int ebml_level_end(MatroskaDemuxContext *matroska) if (matroska->num_levels > 0) { MatroskaLevel *level = &matroska->levels[matroska->num_levels - 1]; - if (pos - level->start >= level->length) { + if (pos - level->start >= level->length || matroska->current_id) { matroska->num_levels--; return 1; } @@ -716,6 +716,10 @@ static int ebml_parse_id(MatroskaDemuxContext *matroska, EbmlSyntax *syntax, for (i=0; syntax[i].id; i++) if (id == syntax[i].id) break; + if (!syntax[i].id && id == MATROSKA_ID_CLUSTER && + matroska->num_levels > 0 && + matroska->levels[matroska->num_levels-1].length == 0xffffffffffffffff) + return 0; // we reached the end of an unknown size cluster if (!syntax[i].id && id != EBML_ID_VOID && id != EBML_ID_CRC32) av_log(matroska->ctx, AV_LOG_INFO, "Unknown entry 0x%X\n", id); return ebml_parse_elem(matroska, &syntax[i], data); |