mruby: annotate that commandv crashes horribly

This commit is contained in:
Stefano Pigozzi 2017-12-30 11:22:24 +01:00
parent 0150257839
commit 614ff9e024
1 changed files with 2 additions and 0 deletions

View File

@ -357,12 +357,14 @@ static mrb_value _command(mrb_state *mrb, mrb_value self)
return api_return_bool(mrb, mpv_command_string(ctx->client, command));
}
// XXX crashes with M.commandv "quit", 0
static mrb_value _commandv(mrb_state *mrb, mrb_value self)
{
struct script_ctx *ctx = get_ctx(mrb);
mrb_value *commands;
mrb_int size;
mrb_get_args(mrb, "*", &commands, &size);
char **args = talloc_zero_array(NULL, char *, size + 1);
for (int i = 0; i < size; i++)
args[i] = talloc_strdup(args, RSTRING_PTR(commands[i]));