[FFmpeg-cvslog] rtsp: Check a malloc return value

Himangi Saraogi git at videolan.org
Mon Apr 13 01:44:06 CEST 2015


ffmpeg | branch: master | Himangi Saraogi <himangi774 at gmail.com> | Sat Apr  4 16:39:40 2015 +0530| [0b72a47f5592ecc035edd5bac57558ad9604612d] | committer: Martin Storsjö

rtsp: Check a malloc return value

Signed-off-by: Martin Storsjö <martin at martin.st>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=0b72a47f5592ecc035edd5bac57558ad9604612d
---

 libavformat/rtsp.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c
index 1c2c555..3246718 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);



More information about the ffmpeg-cvslog mailing list