diff options
author | Vittorio Giovara <vittorio.giovara@gmail.com> | 2015-11-09 15:14:43 +0100 |
---|---|---|
committer | Vittorio Giovara <vittorio.giovara@gmail.com> | 2015-11-12 04:39:14 +0100 |
commit | b5f963bfec1f452c37eee900c7b11f065d10dd60 (patch) | |
tree | 033ad9f27cfcbfe0ae67105f408d7be966e3d41b /libavformat/mov.c | |
parent | 303f931938c618668f7f83c646a1850bef84641e (diff) | |
download | ffmpeg-b5f963bfec1f452c37eee900c7b11f065d10dd60.tar.gz |
mov: Drop dref when unable to parse
Some entries might be either empty or contain types we do not parse
(eg. 'url '). In both cases, if an 'alis' is not the first entry,
external references are not loaded, so make sure that the array starts
with an 'alis' dref.
Diffstat (limited to 'libavformat/mov.c')
-rw-r--r-- | libavformat/mov.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/libavformat/mov.c b/libavformat/mov.c index 2982bf2811..c7495772fe 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -482,7 +482,7 @@ static int mov_read_dref(MOVContext *c, AVIOContext *pb, MOVAtom atom) return AVERROR(ENOMEM); sc->drefs_count = entries; - for (i = 0; i < sc->drefs_count; i++) { + for (i = 0; i < entries; i++) { MOVDref *dref = &sc->drefs[i]; uint32_t size = avio_rb32(pb); int64_t next = avio_tell(pb) + size - 4; @@ -577,6 +577,11 @@ static int mov_read_dref(MOVContext *c, AVIOContext *pb, MOVAtom atom) } else avio_skip(pb, len); } + } else { + av_log(c->fc, AV_LOG_DEBUG, "Unknown dref type 0x08%x size %d\n", + dref->type, size); + entries--; + i--; } avio_seek(pb, next, SEEK_SET); } |