diff options
author | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2024-03-25 13:34:42 +0100 |
---|---|---|
committer | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2024-03-28 03:08:01 +0100 |
commit | aa7d6520e6335f9ed45ca2bf0fbf932fb4b2dea6 (patch) | |
tree | 9de0705ec0409aab0eba2c4117be2e3b1d6eb05d /libavfilter | |
parent | 686d33a6b039e7abd6de6182449d49132ce157a1 (diff) | |
download | ffmpeg-aa7d6520e6335f9ed45ca2bf0fbf932fb4b2dea6.tar.gz |
avutil/opt: Avoid av_strdup(NULL)
It is not documented to be safe and in any case it is nonsense:
Currently av_strdup(NULL) returns NULL and in order to distinguish
this from a genuine allocation failure, opt_copy_elem()
checked afterwards whether src was actually NULL. But then one
can simply check in advance whether one should call av_strdup()
at all.
set_string() was even worse and returned ENOMEM in case the value
to be duplicated is NULL; this only worked because
av_opt_set_defaults2() does not check the return value at all
(given that it can't propagate it).
These two places account for 389114 of 390356 av_strdup(NULL)
calls during one FATE run.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavfilter')
0 files changed, 0 insertions, 0 deletions