From 433210535244e94d20d92eb272d27097daea9a11 Mon Sep 17 00:00:00 2001 From: wm4 Date: Fri, 3 Oct 2014 01:24:48 +0200 Subject: command: allow passing memory addresses to overlay_add For the sake of libmpv. Might make things much easier for the user, especially on Windows. On the other hand, it's a bit sketchy that a command exists that makes the player access arbitrary memory regions. (But do note that input commands are not meant to be "secure" and never were - for example, there's the "run" command, which obviously allows running random shell commands.) --- player/command.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'player/command.c') diff --git a/player/command.c b/player/command.c index ef75594f7b..1b0a7df0cb 100644 --- a/player/command.c +++ b/player/command.c @@ -3326,6 +3326,12 @@ static int overlay_add(struct MPContext *mpctx, int id, int x, int y, if (!file[1] || end[0]) fd = -1; close_fd = false; + } else if (file[0] == '&') { + char *end; + unsigned long long addr = strtoull(&file[1], &end, 0); + if (!file[1] || end[0]) + addr = 0; + p = (void *)(uintptr_t)addr; } else { fd = open(file, O_RDONLY | O_BINARY | O_CLOEXEC); } -- cgit v1.2.3