You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-11-29 05:57:37 +02:00
make av_strdup(NULL) return NULL
Originally committed as revision 13250 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
@@ -139,11 +139,13 @@ void *av_mallocz(unsigned int size)
|
|||||||
|
|
||||||
char *av_strdup(const char *s)
|
char *av_strdup(const char *s)
|
||||||
{
|
{
|
||||||
char *ptr;
|
char *ptr= NULL;
|
||||||
|
if(s){
|
||||||
int len = strlen(s) + 1;
|
int len = strlen(s) + 1;
|
||||||
ptr = av_malloc(len);
|
ptr = av_malloc(len);
|
||||||
if (ptr)
|
if (ptr)
|
||||||
memcpy(ptr, s, len);
|
memcpy(ptr, s, len);
|
||||||
|
}
|
||||||
return ptr;
|
return ptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user