Reviewed-by: Matt Oliver <protogonoi@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 3bf142c77337814458ed8e036796934032d9837f)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
... | ... |
@@ -106,6 +106,15 @@ static void log_callback_report(void *ptr, int level, const char *fmt, va_list v |
106 | 106 |
} |
107 | 107 |
} |
108 | 108 |
|
109 |
+void init_dynload(void) |
|
110 |
+{ |
|
111 |
+#ifdef _WIN32 |
|
112 |
+ /* Calling SetDllDirectory with the empty string (but not NULL) removes the |
|
113 |
+ * current working directory from the DLL search path as a security pre-caution. */ |
|
114 |
+ SetDllDirectory(""); |
|
115 |
+#endif |
|
116 |
+} |
|
117 |
+ |
|
109 | 118 |
static void (*program_exit)(int ret); |
110 | 119 |
|
111 | 120 |
void register_exit(void (*cb)(int ret)) |
... | ... |
@@ -62,6 +62,11 @@ void register_exit(void (*cb)(int ret)); |
62 | 62 |
void exit_program(int ret) av_noreturn; |
63 | 63 |
|
64 | 64 |
/** |
65 |
+ * Initialize dynamic library loading |
|
66 |
+ */ |
|
67 |
+void init_dynload(void); |
|
68 |
+ |
|
69 |
+/** |
|
65 | 70 |
* Initialize the cmdutils option system, in particular |
66 | 71 |
* allocate the *_opts contexts. |
67 | 72 |
*/ |