summaryrefslogtreecommitdiffstats
path: root/video/filter
diff options
context:
space:
mode:
authorKevin Mitchell <kevmitch@gmail.com>2014-04-29 08:00:52 -0700
committerKevin Mitchell <kevmitch@gmail.com>2014-04-29 08:31:44 -0700
commite3e565c194580c0601568528b9bd2033ae0e6f70 (patch)
tree0090511f30817c1de04fc4295fe9a10f505b54d3 /video/filter
parent164cfeba56af9806f7b164842d50a4ea1627979a (diff)
downloadmpv-e3e565c194580c0601568528b9bd2033ae0e6f70.tar.bz2
mpv-e3e565c194580c0601568528b9bd2033ae0e6f70.tar.xz
vf-metadata: fix handling of NULL metadata
lavfi would segfault due to a NULL dereference if it was asked for its metadata and none had been allocated (oops). This happens for libav which has no concept of filter metadata.
Diffstat (limited to 'video/filter')
-rw-r--r--video/filter/vf_lavfi.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/video/filter/vf_lavfi.c b/video/filter/vf_lavfi.c
index f2de4fe9a4..2002c97d16 100644
--- a/video/filter/vf_lavfi.c
+++ b/video/filter/vf_lavfi.c
@@ -334,10 +334,13 @@ static int control(vf_instance_t *vf, int request, void *data)
case VFCTRL_SEEK_RESET:
reset(vf);
return CONTROL_OK;
- case VFCTRL_GET_METADATA:{
- *(struct mp_tags*) data = *vf->priv->metadata;
- return CONTROL_OK;
- }
+ case VFCTRL_GET_METADATA:
+ if (vf->priv && vf->priv->metadata) {
+ *(struct mp_tags*) data = *vf->priv->metadata;
+ return CONTROL_OK;
+ } else {
+ return CONTROL_NA;
+ }
}
return CONTROL_UNKNOWN;
}