diff --git a/libavutil/mem.c b/libavutil/mem.c index 8062ae81cb..3eaa366d53 100644 --- a/libavutil/mem.c +++ b/libavutil/mem.c @@ -139,11 +139,13 @@ void *av_mallocz(unsigned int size) char *av_strdup(const char *s) { - char *ptr; + char *ptr= NULL; + if(s){ int len = strlen(s) + 1; ptr = av_malloc(len); if (ptr) memcpy(ptr, s, len); + } return ptr; }