diff options
author | wm4 <wm4@nowhere> | 2015-03-06 10:48:34 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2015-03-06 11:31:05 +0100 |
commit | 4dd7104af8f8ff10a81d6e9944e50a62f7b7e04f (patch) | |
tree | 7fd8fa093b3b317fcd7b79a00cf89b989aa24dd6 /osdep/macosx_application.m | |
parent | e9ff136dd3e5200f95e92739333e2d303e8fd174 (diff) | |
download | mpv-4dd7104af8f8ff10a81d6e9944e50a62f7b7e04f.tar.bz2 mpv-4dd7104af8f8ff10a81d6e9944e50a62f7b7e04f.tar.xz |
osx: terminate argv properly when arguments are removed
The player now relies on the (slightly obscure) requirement that argv is
NULL-terminated.
Might fix #1652.
Diffstat (limited to 'osdep/macosx_application.m')
-rw-r--r-- | osdep/macosx_application.m | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/osdep/macosx_application.m b/osdep/macosx_application.m index 818d8df379..ac1f4863da 100644 --- a/osdep/macosx_application.m +++ b/osdep/macosx_application.m @@ -366,7 +366,10 @@ int cocoa_main(mpv_main_fn mpv_main, int argc, char *argv[]) ctx.argv = &argv; if (bundle_started_from_finder(argc, argv)) { - argc = 1; // clears out -psn argument is present + if (argc > 1) { + argc = 1; // clears out -psn argument if present + argv[1] = NULL; + } macosx_redirect_output_to_logfile("mpv"); init_cocoa_application(true); } else { |