summaryrefslogtreecommitdiffstats
path: root/video/filter
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-11-06 21:12:20 +0100
committerwm4 <wm4@nowhere>2015-11-06 21:12:20 +0100
commit9693e0f57ac75bd5c5d8313dd933989dd3e64d31 (patch)
treed60148c9d7906da869157f8d9b5aa49042af5543 /video/filter
parent647b360a0aa0a3f8cce75812f9d7eac5a78b7a06 (diff)
downloadmpv-9693e0f57ac75bd5c5d8313dd933989dd3e64d31.tar.bz2
mpv-9693e0f57ac75bd5c5d8313dd933989dd3e64d31.tar.xz
Remove some VLAs
They are evil and should be eradicated. Some of these were pretty dumb anyway. There are probably some more around in platform specific code or other code not enabled by default on Linux.
Diffstat (limited to 'video/filter')
-rw-r--r--video/filter/vf.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/video/filter/vf.c b/video/filter/vf.c
index 6ad484c7ff..b16c0b3627 100644
--- a/video/filter/vf.c
+++ b/video/filter/vf.c
@@ -269,12 +269,15 @@ static vf_instance_t *vf_open_filter(struct vf_chain *c, const char *name,
for (i = 0; args && args[2 * i]; i++)
l += 1 + strlen(args[2 * i]) + 1 + strlen(args[2 * i + 1]);
l += strlen(name);
- char str[l + 1];
+ char *str = malloc(l + 1);
+ if (!str)
+ return NULL;
char *p = str;
p += sprintf(str, "%s", name);
for (i = 0; args && args[2 * i]; i++)
p += sprintf(p, " %s=%s", args[2 * i], args[2 * i + 1]);
MP_INFO(c, "Opening video filter: [%s]\n", str);
+ free(str);
return vf_open(c, name, args);
}