[FFmpeg-devel] [PATCH] lavf/os_support: Add safe win32 dlopen/dlclose/dlsym functions.

Matt Oliver protogonoi at gmail.com
Mon Aug 29 09:49:02 EEST 2016


On 28 August 2016 at 19:58, Michael Niedermayer <michael at niedermayer.cc>
wrote:

> On Sun, Aug 28, 2016 at 06:50:58PM +1000, Matt Oliver wrote:
> > The dlopen function is modified to prevent loading dll's from the current
> > directory for improved program security for library users. This extends
> > similar functionality from the recently applied  SetDllDirectory patch
> > except that it adds additional security for library users as well (as
> > opposed to just program users).
>
> >  os_support.h |   49 +++++++++++++++++++++++++++++++++++++++++++++++++
> >  1 file changed, 49 insertions(+)
> > 89c775ecc8ac03d001131dd50e043ba57ffe5420  0001-lavf-os_support-Add-safe-
> win32-dlopen-dlclose-dlsym-.patch
> > From 666ab2f7d64cfa94984881aca830355555993365 Mon Sep 17 00:00:00 2001
> > From: Matt Oliver <protogonoi at gmail.com>
> > Date: Sun, 21 Aug 2016 16:06:59 +1000
> > Subject: [PATCH 1/2] lavf/os_support: Add safe win32 dlopen/dlclose/dlsym
> >  functions.
>
> breaks mingw32
>
> In file included from src/libavformat/internal.h:28:0,
>                  from src/libavdevice/lavfi.c:44:
> src/libavformat/os_support.h: In function ‘win32_dlopen’:
> src/libavformat/os_support.h:303:46: error: ‘LOAD_LIBRARY_SEARCH_APPLICATION_DIR’
> undeclared (first use in this function)
> src/libavformat/os_support.h:303:46: note: each undeclared identifier is
> reported only once for each function it appears in
> src/libavformat/os_support.h:303:84: error:
> ‘LOAD_LIBRARY_SEARCH_SYSTEM32’ undeclared (first use in this function)
> In file included from src/libavformat/internal.h:28:0,
>                  from src/libavdevice/gdigrab.c:32:
> src/libavformat/os_support.h: In function ‘win32_dlopen’:
> src/libavformat/os_support.h:303:46: error: ‘LOAD_LIBRARY_SEARCH_APPLICATION_DIR’
> undeclared (first use in this function)
> src/libavformat/os_support.h:303:46: note: each undeclared identifier is
> reported only once for each function it appears in
> src/libavformat/os_support.h:303:84: error:
> ‘LOAD_LIBRARY_SEARCH_SYSTEM32’ undeclared (first use in this function)
> make: *** [libavdevice/lavfi.o] Error 1
>

It appears older versions of mingw must not have the appropriate defines
(as the version i tested against worked fine).
Anyway updated patch attached which corrects the issue.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-lavf-os_support-Add-safe-win32-dlopen-dlclose-dlsym-.patch
Type: application/octet-stream
Size: 2946 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20160829/a389f81f/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-Modify-existing-dll-loading-to-use-new-safe-dlopen.patch
Type: application/octet-stream
Size: 5096 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20160829/a389f81f/attachment-0001.obj>


More information about the ffmpeg-devel mailing list