smoothstream: check malloc calls
authorNidhi Makhijani <nidhimj22@gmail.com>
Thu, 22 May 2014 10:50:05 +0000 (16:20 +0530)
committerAnton Khirnov <anton@khirnov.net>
Sat, 24 May 2014 06:21:49 +0000 (08:21 +0200)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
libavformat/smoothstreamingenc.c

index 2fe01b1..9fe4fe5 100644 (file)
@@ -154,6 +154,8 @@ static void get_private_data(OutputStream *os)
     if (!ptr)
         return;
     os->private_str = av_mallocz(2*size + 1);
+    if (!os->private_str)
+        return;
     for (i = 0; i < size; i++)
         snprintf(&os->private_str[2*i], 3, "%02x", ptr[i]);
     if (ptr != codec->extradata)