[FFmpeg-devel] [PATCH] libavformat.v, libavutil.v: tighten export whitelist

Scott Theisen scott.the.elm at gmail.com
Fri Jul 4 00:05:55 EEST 2025


On 2025/07/03 12:32, James Almer wrote:
> On 7/3/2025 1:28 PM, Andreas Rheinhardt wrote:
>> Scott Theisen:
>>> This matches how the other libraries define their exported symbols.
>>> ---
>>>   libavformat/libavformat.v | 5 ++++-
>>>   libavutil/libavutil.v     | 4 +++-
>>>   2 files changed, 7 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/libavformat/libavformat.v b/libavformat/libavformat.v
>>> index 47d5ddcdb1..39aa185309 100644
>>> --- a/libavformat/libavformat.v
>>> +++ b/libavformat/libavformat.v
>>> @@ -1,6 +1,9 @@
>>>   LIBAVFORMAT_MAJOR {
>>>       global:
>>> -        av*;
>>> +        av_*;
>>> +        avformat_*;
>>> +        avio_*;
>>> +        avpriv_*;
>>>       local:
>>>           *;
>>>   };
>>> diff --git a/libavutil/libavutil.v b/libavutil/libavutil.v
>>> index fb17058df5..e1aab84554 100644
>>> --- a/libavutil/libavutil.v
>>> +++ b/libavutil/libavutil.v
>>> @@ -1,6 +1,8 @@
>>>   LIBAVUTIL_MAJOR {
>>>       global:
>>> -        av*;
>>> +        av_*;
>>> +        avutil_*;
>>> +        avpriv_*;
>>>       local:
>>>           *;
>>>   };
>>
>> Is  there a problem with the current lists?
>
> Don't think so, but this ensures no symbol is unintentionally 
> exported, so IMO it's fine.

The main idea was to make searching for uses of the exported symbols (in 
another codebase) easier since searching for "av" produces a lot of 
false positives.

It also makes it clearer what symbols are exported and that libavformat 
has additional exports starting with avio_ (i.e. not av_, av(library 
name)_, or avpriv_).

I did not see any symbols that were exported under av* that are not 
exported using the more specific rules.



More information about the ffmpeg-devel mailing list