Commit aac8fe4d authored by aurel's avatar aurel

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


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@23589 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 37c5e19b
......@@ -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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment