rtsp: Check a memory allocation
authorMichael Lynch <mtlynch@google.com>
Tue, 14 Oct 2014 20:30:39 +0000 (16:30 -0400)
committerMartin Storsjö <martin@martin.st>
Thu, 16 Oct 2014 06:19:03 +0000 (09:19 +0300)
CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
libavformat/rtsp.c

index d574797..52f52a1 100644 (file)
@@ -1146,6 +1146,8 @@ start:
     if (content_length > 0) {
         /* leave some room for a trailing '\0' (useful for simple parsing) */
         content = av_malloc(content_length + 1);
+        if (!content)
+            return AVERROR(ENOMEM);
         ffurl_read_complete(rt->rtsp_hd, content, content_length);
         content[content_length] = '\0';
     }