From 0b72a47f5592ecc035edd5bac57558ad9604612d Mon Sep 17 00:00:00 2001 From: Himangi Saraogi Date: Sat, 4 Apr 2015 16:21:40 +0530 Subject: rtsp: Check a malloc return value MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Martin Storsjö --- libavformat/rtsp.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'libavformat/rtsp.c') diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c index 1c2c5552b9..3246718bf1 100644 --- a/libavformat/rtsp.c +++ b/libavformat/rtsp.c @@ -2239,6 +2239,8 @@ static int sdp_read_header(AVFormatContext *s) /* read the whole sdp file */ /* XXX: better loading */ content = av_malloc(SDP_MAX_SIZE); + if (!content) + return AVERROR(ENOMEM); size = avio_read(s->pb, content, SDP_MAX_SIZE - 1); if (size <= 0) { av_free(content); -- cgit v1.2.3