Browse Source

movdec: Read extended 64bit size before the debug av_log() and only when there

was enough space to read the 32bit size.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
tags/n0.9
Michael Niedermayer 13 years ago
parent
commit
7d90bc9f2a
1 changed files with 4 additions and 4 deletions
  1. +4
    -4
      libavformat/mov.c

+ 4
- 4
libavformat/mov.c View File

@@ -315,13 +315,13 @@ static int mov_read_default(MOVContext *c, AVIOContext *pb, MOVAtom atom)
a.size = avio_rb32(pb); a.size = avio_rb32(pb);
a.type = avio_rl32(pb); a.type = avio_rl32(pb);
total_size += 8; total_size += 8;
if (a.size == 1) { /* 64 bit extended size */
a.size = avio_rb64(pb) - 8;
total_size += 8;
}
} }
av_dlog(c->fc, "type: %08x '%.4s' parent:'%.4s' sz: %"PRId64" %"PRId64" %"PRId64"\n", av_dlog(c->fc, "type: %08x '%.4s' parent:'%.4s' sz: %"PRId64" %"PRId64" %"PRId64"\n",
a.type, (char*)&a.type, (char*)&atom.type, a.size, total_size, atom.size); a.type, (char*)&a.type, (char*)&atom.type, a.size, total_size, atom.size);
if (a.size == 1) { /* 64 bit extended size */
a.size = avio_rb64(pb) - 8;
total_size += 8;
}
if (a.size == 0) { if (a.size == 0) {
a.size = atom.size - total_size + 8; a.size = atom.size - total_size + 8;
if (a.size <= 8) if (a.size <= 8)


Loading…
Cancel
Save