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>
... | ... |
@@ -111,6 +111,15 @@ static void log_callback_report(void *ptr, int level, const char *fmt, va_list v |
111 | 111 |
} |
112 | 112 |
} |
113 | 113 |
|
114 |
+void init_dynload(void) |
|
115 |
+{ |
|
116 |
+#ifdef _WIN32 |
|
117 |
+ /* Calling SetDllDirectory with the empty string (but not NULL) removes the |
|
118 |
+ * current working directory from the DLL search path as a security pre-caution. */ |
|
119 |
+ SetDllDirectory(""); |
|
120 |
+#endif |
|
121 |
+} |
|
122 |
+ |
|
114 | 123 |
static void (*program_exit)(int ret); |
115 | 124 |
|
116 | 125 |
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 |
*/ |