summaryrefslogtreecommitdiff
path: root/libavformat/avisynth.c
diff options
context:
space:
mode:
authorMatt Oliver <protogonoi@gmail.com>2016-10-31 14:30:43 +1100
committerMatt Oliver <protogonoi@gmail.com>2016-11-05 18:08:53 +1100
commitd6f85ec2700e40b3ec864d5ee405b7e257778e1f (patch)
treed0ea3c2137c1d1fe94743df71242d3d8e8dc766c /libavformat/avisynth.c
parent85db1f97eb506b7b0fd876f428872b89f967cc53 (diff)
downloadffmpeg-d6f85ec2700e40b3ec864d5ee405b7e257778e1f.tar.gz
avformat/avisynth.c: Use new safe dlopen code.
Signed-off-by: Matt Oliver <protogonoi@gmail.com>
Diffstat (limited to 'libavformat/avisynth.c')
-rw-r--r--libavformat/avisynth.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/libavformat/avisynth.c b/libavformat/avisynth.c
index 1acc44f4c5..514cb99f49 100644
--- a/libavformat/avisynth.c
+++ b/libavformat/avisynth.c
@@ -29,7 +29,7 @@
/* Platform-specific directives for AviSynth vs AvxSynth. */
#ifdef _WIN32
- #include <windows.h>
+ #include "compat/w32dlfcn.h"
#undef EXTERN_C
#include "compat/avisynth/avisynth_c.h"
#define AVISYNTH_LIB "avisynth"
@@ -39,10 +39,6 @@
#include "compat/avisynth/avxsynth_c.h"
#define AVISYNTH_NAME "libavxsynth"
#define AVISYNTH_LIB AVISYNTH_NAME SLIBSUF
-
- #define LoadLibrary(x) dlopen(x, RTLD_NOW | RTLD_LOCAL)
- #define GetProcAddress dlsym
- #define FreeLibrary dlclose
#endif
typedef struct AviSynthLibrary {
@@ -118,13 +114,13 @@ static av_cold void avisynth_atexit_handler(void);
static av_cold int avisynth_load_library(void)
{
- avs_library.library = LoadLibrary(AVISYNTH_LIB);
+ avs_library.library = dlopen(AVISYNTH_LIB, RTLD_NOW | RTLD_LOCAL);
if (!avs_library.library)
return AVERROR_UNKNOWN;
#define LOAD_AVS_FUNC(name, continue_on_fail) \
avs_library.name = \
- (void *)GetProcAddress(avs_library.library, #name); \
+ (void *)dlsym(avs_library.library, #name); \
if (!continue_on_fail && !avs_library.name) \
goto fail;
@@ -157,7 +153,7 @@ static av_cold int avisynth_load_library(void)
return 0;
fail:
- FreeLibrary(avs_library.library);
+ dlclose(avs_library.library);
return AVERROR_UNKNOWN;
}
@@ -225,7 +221,7 @@ static av_cold void avisynth_atexit_handler(void)
avisynth_context_destroy(avs);
avs = next;
}
- FreeLibrary(avs_library.library);
+ dlclose(avs_library.library);
avs_atexit_called = 1;
}