[FFmpeg-cvslog] avformat/rtsp: check memory allocation

Michael Lynch git at videolan.org
Wed Oct 15 20:14:42 CEST 2014


ffmpeg | branch: master | Michael Lynch <mtlynch at google.com> | Tue Oct 14 16:30:39 2014 -0400| [c69f230a3afbfa30d7a978a6961b1ddcc774499f] | committer: Michael Niedermayer

avformat/rtsp: check memory allocation

Reviewed-by: Reimar Döffinger <Reimar.Doeffinger at gmx.de>
Commit message by: Benoit Fouet <benoit.fouet at free.fr>
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

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

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

diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c
index 523a7c0..77f03ba 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';
     }



More information about the ffmpeg-cvslog mailing list