You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-15 14:13:16 +02:00
avutil/opt: dont crash on av_opt_set_dict() with NULL
This allows calling the function without the need to check if the dictionary contains any entries Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
@@ -1421,6 +1421,9 @@ int av_opt_set_dict(void *obj, AVDictionary **options)
|
|||||||
AVDictionary *tmp = NULL;
|
AVDictionary *tmp = NULL;
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
|
||||||
|
if (!options)
|
||||||
|
return 0;
|
||||||
|
|
||||||
while ((t = av_dict_get(*options, "", t, AV_DICT_IGNORE_SUFFIX))) {
|
while ((t = av_dict_get(*options, "", t, AV_DICT_IGNORE_SUFFIX))) {
|
||||||
ret = av_opt_set(obj, t->key, t->value, 0);
|
ret = av_opt_set(obj, t->key, t->value, 0);
|
||||||
if (ret == AVERROR_OPTION_NOT_FOUND)
|
if (ret == AVERROR_OPTION_NOT_FOUND)
|
||||||
|
Reference in New Issue
Block a user