diff options
author | Derek Buitenhuis <derek.buitenhuis@gmail.com> | 2016-01-20 17:27:09 +0000 |
---|---|---|
committer | Luca Barbato <lu_zero@gentoo.org> | 2016-01-21 14:32:39 +0100 |
commit | 65d29dd274a302131e2e4bc6d2b1eca4a093900c (patch) | |
tree | a7196ed90a4e1d19db8d0ee158eb4dbcbcfb69e4 /libavformat/mov.c | |
parent | 883ad2c59ceea1ced5495b5ccc83695ed4bbb94b (diff) |
mov: Add an option to toggle dref opening
This feature is mostly only used by NLE software, and is
both of dubious value being enabled by default, and a
possible security risk.
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
Diffstat (limited to 'libavformat/mov.c')
-rw-r--r-- | libavformat/mov.c | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/libavformat/mov.c b/libavformat/mov.c index aaf1c2db9a..28d78e3dcb 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -2484,12 +2484,22 @@ static int mov_read_trak(MOVContext *c, AVIOContext *pb, MOVAtom atom) if (sc->dref_id-1 < sc->drefs_count && sc->drefs[sc->dref_id-1].path) { MOVDref *dref = &sc->drefs[sc->dref_id - 1]; - if (mov_open_dref(&sc->pb, c->fc->filename, dref, &c->fc->interrupt_callback) < 0) - av_log(c->fc, AV_LOG_ERROR, - "stream %d, error opening alias: path='%s', dir='%s', " - "filename='%s', volume='%s', nlvl_from=%d, nlvl_to=%d\n", + if (c->enable_drefs) { + if (mov_open_dref(&sc->pb, c->fc->filename, dref, &c->fc->interrupt_callback) < 0) + av_log(c->fc, AV_LOG_ERROR, + "stream %d, error opening alias: path='%s', dir='%s', " + "filename='%s', volume='%s', nlvl_from=%d, nlvl_to=%d\n", + st->index, dref->path, dref->dir, dref->filename, + dref->volume, dref->nlvl_from, dref->nlvl_to); + } else { + av_log(c->fc, AV_LOG_WARNING, + "Skipped opening external track: " + "stream %d, alias: path='%s', dir='%s', " + "filename='%s', volume='%s', nlvl_from=%d, nlvl_to=%d." + "Set enable_drefs to allow this.\n", st->index, dref->path, dref->dir, dref->filename, dref->volume, dref->nlvl_from, dref->nlvl_to); + } } else sc->pb = c->fc->pb; @@ -3643,6 +3653,8 @@ static const AVOption mov_options[] = { AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, .flags = FLAGS }, { "export_xmp", "Export full XMP metadata", OFFSET(export_xmp), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, .flags = FLAGS }, + { "enable_drefs", "Enable external track support.", OFFSET(enable_drefs), + AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, .flags = FLAGS }, { NULL }, }; |