From c69f230a3afbfa30d7a978a6961b1ddcc774499f Mon Sep 17 00:00:00 2001 From: Michael Lynch Date: Tue, 14 Oct 2014 16:30:39 -0400 Subject: [PATCH] avformat/rtsp: check memory allocation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reviewed-by: Reimar Döffinger Commit message by: Benoit Fouet Signed-off-by: Michael Niedermayer --- libavformat/rtsp.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c index 523a7c0439..77f03bac30 100644 --- a/libavformat/rtsp.c +++ b/libavformat/rtsp.c @@ -1150,6 +1150,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'; }