avutil/dict: Use size_t for appending strings
authorMichael Niedermayer <michaelni@gmx.at>
Sun, 10 May 2015 14:09:07 +0000 (16:09 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Fri, 15 May 2015 08:04:51 +0000 (10:04 +0200)
the string length is not constrained to INT_MAX

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 4c128ea1629116fc4936edc5f96bbd18f3ef1647)

Conflicts:

libavutil/dict.c

libavutil/dict.c

index 0d54c79..caec50e 100644 (file)
@@ -107,7 +107,7 @@ int av_dict_set(AVDictionary **pm, const char *key, const char *value,
         if (flags & AV_DICT_DONT_STRDUP_VAL) {
             m->elems[m->count].value = (char*)(intptr_t)value;
         } else if (oldval && flags & AV_DICT_APPEND) {
-            int len = strlen(oldval) + strlen(value) + 1;
+            size_t len = strlen(oldval) + strlen(value) + 1;
             char *newval = av_mallocz(len);
             if (!newval)
                 goto err_out;