[FFmpeg-devel] [FFmpeg-cvslog] avfilter/af_ladspa: check another directory for plugins

Alexander Strasser eclipse7 at gmx.net
Sun Jun 21 22:19:06 EEST 2020


Hi Paul!

On 2020-06-21 12:49 +0000, Paul B Mahol wrote:
> ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Sun Jun 21 14:46:29 2020 +0200| [842bc312ade8fab82465423b22c4fbe3bee63383] | committer: Paul B Mahol
>
> avfilter/af_ladspa: check another directory for plugins
>
> > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=842bc312ade8fab82465423b22c4fbe3bee63383
> ---
>
>  libavfilter/af_ladspa.c | 5 +++++
>  1 file changed, 5 insertions(+)
>
> diff --git a/libavfilter/af_ladspa.c b/libavfilter/af_ladspa.c
> index a8562fc073..68537c5029 100644
> --- a/libavfilter/af_ladspa.c
> +++ b/libavfilter/af_ladspa.c
> @@ -426,6 +426,11 @@ static av_cold int init(AVFilterContext *ctx)
>          }
>
>          av_free(paths);
> +        if (!s->dl_handle && (paths = av_asprintf("%s/.ladspa", getenv("HOME")))) {

I think this will result in undefined behavior by using %s with a NULL
argument if HOME isn't found in the environment.

As there's at least one more occurrence (see diff context below), it
would probably be best to define a file local helper function.


  Alexander

> +            s->dl_handle = try_load(paths, s->dl_name);
> +            av_free(paths);
> +        }
> +
>          if (!s->dl_handle && (paths = av_asprintf("%s/.ladspa/lib", getenv("HOME")))) {
>              s->dl_handle = try_load(paths, s->dl_name);
>              av_free(paths);


More information about the ffmpeg-devel mailing list