libavutil/mem: use size_t for the length in av_strdup()

the string length is not constrained to INT_MAX

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer
2015-05-10 16:06:50 +02:00
parent bb523c1b86
commit dc8f42e037

View File

@@ -259,7 +259,7 @@ char *av_strdup(const char *s)
{ {
char *ptr = NULL; char *ptr = NULL;
if (s) { if (s) {
int len = strlen(s) + 1; size_t len = strlen(s) + 1;
ptr = av_realloc(NULL, len); ptr = av_realloc(NULL, len);
if (ptr) if (ptr)
memcpy(ptr, s, len); memcpy(ptr, s, len);