diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-03-30 14:58:46 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-03-30 15:00:03 +0200 |
commit | d9a3501c33a1f88350c935785dbf5435e9ffabe6 (patch) | |
tree | 1d97d9878dfda31234750d58935520618288ef4f | |
parent | 31ac3f306c45ed6bbc90ced2f17f06d9d809be50 (diff) | |
download | ffmpeg-d9a3501c33a1f88350c935785dbf5435e9ffabe6.tar.gz |
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>
-rw-r--r-- | libavutil/opt.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/libavutil/opt.c b/libavutil/opt.c index 652a2ddbb3..428c4e5839 100644 --- a/libavutil/opt.c +++ b/libavutil/opt.c @@ -1421,6 +1421,9 @@ int av_opt_set_dict(void *obj, AVDictionary **options) AVDictionary *tmp = NULL; int ret = 0; + if (!options) + return 0; + while ((t = av_dict_get(*options, "", t, AV_DICT_IGNORE_SUFFIX))) { ret = av_opt_set(obj, t->key, t->value, 0); if (ret == AVERROR_OPTION_NOT_FOUND) |