diff mbox series

[FFmpeg-devel,17/17] avcodec/libavcodec.v: Tighten export whitelist

Message ID HE1PR0301MB2154C34A2FC9ED2FD5B674798F319@HE1PR0301MB2154.eurprd03.prod.outlook.com
State Accepted
Commit e1836b191b8ce956bebf050e664975f2e0f92325
Headers show
Series [FFmpeg-devel,01/17] avcodec/avcodec: Stop including bsf.h in avcodec.h
Related show

Checks

Context Check Description
andriy/x86_make success Make finished
andriy/x86_make_fate success Make fate finished
andriy/PPC64_make success Make finished
andriy/PPC64_make_fate success Make fate finished

Commit Message

Andreas Rheinhardt June 14, 2021, 10:41 p.m. UTC
Currently every symbol (with external linkage) that starts with "av" is
exported. Yet libaom-av1 has lots of functions that are not meant to be
exported and start with "av1_" (I counted 1236); and libvpx has
average_split_mvs. These functions are exported if one links these
libraries statically into a shared libavcodec.so.

Solve this by tightening the whitelist to "av_", "avcodec_", "avpriv_"
and (as a special-case) "avsubtitle_free".

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavcodec/libavcodec.v | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Comments

Michael Niedermayer June 15, 2021, 2:38 p.m. UTC | #1
On Tue, Jun 15, 2021 at 12:41:33AM +0200, Andreas Rheinhardt wrote:
> Currently every symbol (with external linkage) that starts with "av" is
> exported. Yet libaom-av1 has lots of functions that are not meant to be
> exported and start with "av1_" (I counted 1236); and libvpx has
> average_split_mvs. These functions are exported if one links these
> libraries statically into a shared libavcodec.so.
> 
> Solve this by tightening the whitelist to "av_", "avcodec_", "avpriv_"
> and (as a special-case) "avsubtitle_free".
> 
> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
> ---
>  libavcodec/libavcodec.v | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)

sounds like a good idea

thanks!

[...]
diff mbox series

Patch

diff --git a/libavcodec/libavcodec.v b/libavcodec/libavcodec.v
index f1d5e5bc77..d863e056a5 100644
--- a/libavcodec/libavcodec.v
+++ b/libavcodec/libavcodec.v
@@ -1,6 +1,9 @@ 
 LIBAVCODEC_MAJOR {
     global:
-        av*;
+        av_*;
+        avcodec_*;
+        avpriv_*;
+        avsubtitle_free;
     local:
         *;
 };