aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatt Oliver <protogonoi@gmail.com>2019-12-31 02:59:39 +1100
committerMatt Oliver <protogonoi@gmail.com>2020-02-15 23:53:54 +1100
commitf0c0ad4455e5f72edf175e81a06e52562cdd1ab2 (patch)
tree64e9d74f9ba34a4333c007bd9c912155aaa8ad1f
parent314a783bb85fd712cf5e7fc12962ab4182fac8f7 (diff)
downloadffmpeg-f0c0ad4455e5f72edf175e81a06e52562cdd1ab2.tar.gz
avutil/hwcontext_d3d11va: Use secure dlopen.
dlopen contains additional security to prevent dll hijacking compared to standard LoadLibrary.
-rw-r--r--libavutil/hwcontext_d3d11va.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/libavutil/hwcontext_d3d11va.c b/libavutil/hwcontext_d3d11va.c
index 6670c47579..c8ae58f908 100644
--- a/libavutil/hwcontext_d3d11va.c
+++ b/libavutil/hwcontext_d3d11va.c
@@ -39,6 +39,7 @@
#include "pixdesc.h"
#include "pixfmt.h"
#include "thread.h"
+#include "compat/w32dlfcn.h"
typedef HRESULT(WINAPI *PFN_CREATE_DXGI_FACTORY)(REFIID riid, void **ppFactory);
@@ -55,8 +56,8 @@ static av_cold void load_functions(void)
// from too many LoadLibrary calls.
HANDLE d3dlib, dxgilib;
- d3dlib = LoadLibrary("d3d11.dll");
- dxgilib = LoadLibrary("dxgi.dll");
+ d3dlib = dlopen("d3d11.dll", 0);
+ dxgilib = dlopen("dxgi.dll", 0);
if (!d3dlib || !dxgilib)
return;