[FFmpeg-cvslog] avutil/dict: Use size_t for appending strings

Michael Niedermayer git at videolan.org
Sun May 10 16:22:21 CEST 2015


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sun May 10 16:09:07 2015 +0200| [4c128ea1629116fc4936edc5f96bbd18f3ef1647] | committer: Michael Niedermayer

avutil/dict: Use size_t for appending strings

the string length is not constrained to INT_MAX

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=4c128ea1629116fc4936edc5f96bbd18f3ef1647
---

 libavutil/dict.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavutil/dict.c b/libavutil/dict.c
index 4e4ea5f..6ff1af5 100644
--- a/libavutil/dict.c
+++ b/libavutil/dict.c
@@ -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;



More information about the ffmpeg-cvslog mailing list