aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/rtsp.c
diff options
context:
space:
mode:
authorHimangi Saraogi <himangi774@gmail.com>2015-04-04 16:21:40 +0530
committerMartin Storsjö <martin@martin.st>2015-04-12 23:08:13 +0300
commit0b72a47f5592ecc035edd5bac57558ad9604612d (patch)
tree8bb5a22a9b3ff8b454038a8a9261f134ed0ae47a /libavformat/rtsp.c
parentbbdb50d7a8a91f38188fd15080d7f45f1540b3ac (diff)
downloadffmpeg-0b72a47f5592ecc035edd5bac57558ad9604612d.tar.gz
rtsp: Check a malloc return value
Signed-off-by: Martin Storsjö <martin@martin.st>
Diffstat (limited to 'libavformat/rtsp.c')
-rw-r--r--libavformat/rtsp.c2
1 files changed, 2 insertions, 0 deletions
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);