libavformat/hlsenc.c:345: error: Buffer Overrun L3
  Offset: [-1, 0] Size: [0, 2147483631] by call to `av_dict_set`.

libavformat/hlsenc.c:335:20: Call
333. 
334.     if (c->encrypt) {
335.         if ((err = av_dict_copy(&opts, c->enc_opts, 0)) < 0)
                        ^
336.             return err;
337.         if (!c->iv) {

libavutil/dict.c:189:1: Parameter `*src->elems->value`
  187. }
  188. 
  189. int av_dict_copy(AVDictionary **dst, const AVDictionary *src, int flags)
       ^
  190. {
  191.     AVDictionaryEntry *t = NULL;

libavutil/dict.c:194:19: Call
  192. 
  193.     while ((t = av_dict_get(src, "", t, AV_DICT_IGNORE_SUFFIX))) {
  194.         int ret = av_dict_set(dst, t->key, t->value, flags);
                         ^
  195.         if (ret < 0)
  196.             return ret;

libavutil/dict.c:68:1: Parameter `*value`
    66. }
    67. 
    68. int av_dict_set(AVDictionary **pm, const char *key, const char *value,
        ^
    69.                 int flags)
    70. {

libavutil/dict.c:109:13: Assignment
    107.             m->elems[m->count].key = av_strdup(key);
    108.         if (flags & AV_DICT_DONT_STRDUP_VAL) {
    109.             m->elems[m->count].value = value;
                     ^
    110.         } else if (oldval && flags & AV_DICT_APPEND) {
    111.             int len = strlen(oldval) + strlen(value) + 1;

libavformat/hlsenc.c:345:24: Call
343.             buf[32] = '\0';
344. 
345.             if ((err = av_dict_set(&opts, "iv", buf, 0)) < 0)
                            ^
346.                 goto fail;
347.         }

libavutil/dict.c:68:1: <Offset trace>
66. }
67. 
68. int av_dict_set(AVDictionary **pm, const char *key, const char *value,
    ^
69.                 int flags)
70. {

libavutil/dict.c:68:1: Parameter `(*pm)->count`
  66. }
  67. 
  68. int av_dict_set(AVDictionary **pm, const char *key, const char *value,
      ^
  69.                 int flags)
  70. {

libavutil/dict.c:72:30: Call
  70. {
  71.     AVDictionary *m = *pm;
  72.     AVDictionaryEntry *tag = av_dict_get(m, key, NULL, flags);
                                   ^
  73.     char *oldval = NULL;
  74.     int allocated = !!m;

libavutil/dict.c:38:1: Parameter `m->count`
    36. }
    37. 
    38. AVDictionaryEntry *av_dict_get(const AVDictionary *m, const char *key,
        ^
    39.                                const AVDictionaryEntry *prev, int flags)
    40. {

libavutil/dict.c:68:1: <Length trace>
66. }
67. 
68. int av_dict_set(AVDictionary **pm, const char *key, const char *value,
    ^
69.                 int flags)
70. {

libavutil/dict.c:68:1: Parameter `*(*pm)->elems`
  66. }
  67. 
  68. int av_dict_set(AVDictionary **pm, const char *key, const char *value,
      ^
  69.                 int flags)
  70. {

libavutil/dict.c:105:13: Array access: Offset: [-1, 0] Size: [0, 2147483631] by call to `av_dict_set` 
  103.     if (value) {
  104.         if (flags & AV_DICT_DONT_STRDUP_KEY)
  105.             m->elems[m->count].key = key;
                   ^
  106.         else
  107.             m->elems[m->count].key = av_strdup(key);

int av_dict_set(AVDictionary **pm, const char *key, const char *value,
                int flags)
{
    AVDictionary *m = *pm;
    AVDictionaryEntry *tag = av_dict_get(m, key, NULL, flags);
    char *oldval = NULL;
    int allocated = !!m;
    if (!m)
        m = *pm = av_mallocz(sizeof(*m));
    if (!m)
        return AVERROR(ENOMEM);
    if (tag) {
        if (flags & AV_DICT_DONT_OVERWRITE) {
            if (flags & AV_DICT_DONT_STRDUP_KEY) av_free(key);
            if (flags & AV_DICT_DONT_STRDUP_VAL) av_free(value);
            return 0;
        }
        if (flags & AV_DICT_APPEND)
            oldval = tag->value;
        else
            av_free(tag->value);
        av_free(tag->key);
        *tag = m->elems[--m->count];
    } else {
        int ret = av_reallocp_array(&m->elems,
                                    m->count + 1, sizeof(*m->elems));
        if (ret < 0) {
            if (allocated)
                av_freep(pm);
            return ret;
        }
    }
    if (value) {
        if (flags & AV_DICT_DONT_STRDUP_KEY)
            m->elems[m->count].key = key;
        else
            m->elems[m->count].key = av_strdup(key);
        if (flags & AV_DICT_DONT_STRDUP_VAL) {
            m->elems[m->count].value = value;
        } else if (oldval && flags & AV_DICT_APPEND) {
            int len = strlen(oldval) + strlen(value) + 1;
            if (!(oldval = av_realloc(oldval, len)))
                return AVERROR(ENOMEM);
            av_strlcat(oldval, value, len);
            m->elems[m->count].value = oldval;
        } else
            m->elems[m->count].value = av_strdup(value);
        m->count++;
    }
    if (!m->count) {
        av_free(m->elems);
        av_freep(pm);
    }
    return 0;
}
['static int hls_start(AVFormatContext *s)\n{\n    HLSContext *c = s->priv_data;\n    AVFormatContext *oc = c->avf;\n    int err = 0;\n    AVDictionary *opts = NULL;\n    if (av_get_frame_filename(oc->filename, sizeof(oc->filename),\n                              c->basename, c->wrap ? c->sequence % c->wrap : c->sequence) < 0)\n        return AVERROR(EINVAL);\n    c->number++;\n    if (c->encrypt) {\n        if ((err = av_dict_copy(&opts, c->enc_opts, 0)) < 0)\n            return err;\n        if (!c->iv) {\n            uint8_t iv[16] = { 0 };\n            char buf[33];\n            AV_WB64(iv + 8, c->sequence);\n            ff_data_to_hex(buf, iv, sizeof(iv), 0);\n            buf[32] = \'\\0\';\n            if ((err = av_dict_set(&opts, "iv", buf, 0)) < 0)\n                goto fail;\n        }\n    }\n    if ((err = s->io_open(s, &oc->pb, oc->filename, AVIO_FLAG_WRITE, &opts)) < 0)\n        return err;\n    if (oc->oformat->priv_class && oc->priv_data)\n        av_opt_set(oc->priv_data, "mpegts_flags", "resend_headers", 0);\nfail:\n    av_dict_free(&opts);\n    return err;\n}', 'int av_dict_copy(AVDictionary **dst, const AVDictionary *src, int flags)\n{\n    AVDictionaryEntry *t = NULL;\n    while ((t = av_dict_get(src, "", t, AV_DICT_IGNORE_SUFFIX))) {\n        int ret = av_dict_set(dst, t->key, t->value, flags);\n        if (ret < 0)\n            return ret;\n    }\n    return 0;\n}', 'int av_dict_set(AVDictionary **pm, const char *key, const char *value,\n                int flags)\n{\n    AVDictionary *m = *pm;\n    AVDictionaryEntry *tag = av_dict_get(m, key, NULL, flags);\n    char *oldval = NULL;\n    int allocated = !!m;\n    if (!m)\n        m = *pm = av_mallocz(sizeof(*m));\n    if (!m)\n        return AVERROR(ENOMEM);\n    if (tag) {\n        if (flags & AV_DICT_DONT_OVERWRITE) {\n            if (flags & AV_DICT_DONT_STRDUP_KEY) av_free(key);\n            if (flags & AV_DICT_DONT_STRDUP_VAL) av_free(value);\n            return 0;\n        }\n        if (flags & AV_DICT_APPEND)\n            oldval = tag->value;\n        else\n            av_free(tag->value);\n        av_free(tag->key);\n        *tag = m->elems[--m->count];\n    } else {\n        int ret = av_reallocp_array(&m->elems,\n                                    m->count + 1, sizeof(*m->elems));\n        if (ret < 0) {\n            if (allocated)\n                av_freep(pm);\n            return ret;\n        }\n    }\n    if (value) {\n        if (flags & AV_DICT_DONT_STRDUP_KEY)\n            m->elems[m->count].key = key;\n        else\n            m->elems[m->count].key = av_strdup(key);\n        if (flags & AV_DICT_DONT_STRDUP_VAL) {\n            m->elems[m->count].value = value;\n        } else if (oldval && flags & AV_DICT_APPEND) {\n            int len = strlen(oldval) + strlen(value) + 1;\n            if (!(oldval = av_realloc(oldval, len)))\n                return AVERROR(ENOMEM);\n            av_strlcat(oldval, value, len);\n            m->elems[m->count].value = oldval;\n        } else\n            m->elems[m->count].value = av_strdup(value);\n        m->count++;\n    }\n    if (!m->count) {\n        av_free(m->elems);\n        av_freep(pm);\n    }\n    return 0;\n}', 'AVDictionaryEntry *av_dict_get(const AVDictionary *m, const char *key,\n                               const AVDictionaryEntry *prev, int flags)\n{\n    unsigned int i, j;\n    if (!m)\n        return NULL;\n    if (prev)\n        i = prev - m->elems + 1;\n    else\n        i = 0;\n    for (; i < m->count; i++) {\n        const char *s = m->elems[i].key;\n        if (flags & AV_DICT_MATCH_CASE)\n            for (j = 0; s[j] == key[j] && key[j]; j++)\n                ;\n        else\n            for (j = 0; av_toupper(s[j]) == av_toupper(key[j]) && key[j]; j++)\n                ;\n        if (key[j])\n            continue;\n        if (s[j] && !(flags & AV_DICT_IGNORE_SUFFIX))\n            continue;\n        return &m->elems[i];\n    }\n    return NULL;\n}']