changeset 3425:36cdada322a0 libavformat

matroskadec: don't remove dummy level when none was added
author aurel
date Wed, 04 Jun 2008 23:11:47 +0000
parents 7a0230981402
children f773e369f158
files matroskadec.c
diffstat 1 files changed, 3 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/matroskadec.c	Tue Jun 03 16:20:54 2008 +0000
+++ b/matroskadec.c	Wed Jun 04 23:11:47 2008 +0000
@@ -1888,6 +1888,7 @@
             case MATROSKA_ID_SEEKENTRY: {
                 uint32_t seek_id = 0, peek_id_cache = 0;
                 uint64_t seek_pos = (uint64_t) -1, t;
+                int dummy_level = 0;
 
                 if ((res = ebml_read_master(matroska, &id)) < 0)
                     break;
@@ -1964,6 +1965,7 @@
                         level.length = (uint64_t)-1;
                         matroska->levels[matroska->num_levels] = level;
                         matroska->num_levels++;
+                        dummy_level = 1;
 
                         /* check ID */
                         if (!(id = ebml_peek_id (matroska,
@@ -2000,6 +2002,7 @@
 
                     finish:
                         /* remove dummy level */
+                        if (dummy_level)
                         while (matroska->num_levels) {
                             matroska->num_levels--;
                             length =