Commit fc4738ae authored by Aurelien Jacobs's avatar Aurelien Jacobs

matroskadec: don't remove dummy level when none was added

Originally committed as revision 13657 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent d9e5c9b7
...@@ -1888,6 +1888,7 @@ matroska_parse_seekhead (MatroskaDemuxContext *matroska) ...@@ -1888,6 +1888,7 @@ matroska_parse_seekhead (MatroskaDemuxContext *matroska)
case MATROSKA_ID_SEEKENTRY: { case MATROSKA_ID_SEEKENTRY: {
uint32_t seek_id = 0, peek_id_cache = 0; uint32_t seek_id = 0, peek_id_cache = 0;
uint64_t seek_pos = (uint64_t) -1, t; uint64_t seek_pos = (uint64_t) -1, t;
int dummy_level = 0;
if ((res = ebml_read_master(matroska, &id)) < 0) if ((res = ebml_read_master(matroska, &id)) < 0)
break; break;
...@@ -1964,6 +1965,7 @@ matroska_parse_seekhead (MatroskaDemuxContext *matroska) ...@@ -1964,6 +1965,7 @@ matroska_parse_seekhead (MatroskaDemuxContext *matroska)
level.length = (uint64_t)-1; level.length = (uint64_t)-1;
matroska->levels[matroska->num_levels] = level; matroska->levels[matroska->num_levels] = level;
matroska->num_levels++; matroska->num_levels++;
dummy_level = 1;
/* check ID */ /* check ID */
if (!(id = ebml_peek_id (matroska, if (!(id = ebml_peek_id (matroska,
...@@ -2000,6 +2002,7 @@ matroska_parse_seekhead (MatroskaDemuxContext *matroska) ...@@ -2000,6 +2002,7 @@ matroska_parse_seekhead (MatroskaDemuxContext *matroska)
finish: finish:
/* remove dummy level */ /* remove dummy level */
if (dummy_level)
while (matroska->num_levels) { while (matroska->num_levels) {
matroska->num_levels--; matroska->num_levels--;
length = length =
......
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