mirror of https://github.com/FFmpeg/FFmpeg.git
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>release/7.1
parent
686d33a6b0
commit
aa7d6520e6
1 changed files with 7 additions and 3 deletions
Loading…
Reference in new issue