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>
Sun, 10 May 2015 14:09:07 +0000 (16:09 +0200)
the string length is not constrained to INT_MAX

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavutil/dict.c

index 4e4ea5f..6ff1af5 100644 (file)
@@ -109,7 +109,7 @@ int av_dict_set(AVDictionary **pm, const char *key, const char *value,
         m->elems[m->count].key = copy_key;
         m->elems[m->count].value = copy_value;
         if (oldval && flags & AV_DICT_APPEND) {
-            int len = strlen(oldval) + strlen(copy_value) + 1;
+            size_t len = strlen(oldval) + strlen(copy_value) + 1;
             char *newval = av_mallocz(len);
             if (!newval)
                 goto err_out;