[FFmpeg-cvslog] rdt: check malloc calls

Nidhi Makhijani git at videolan.org
Sat May 24 13:32:54 CEST 2014


ffmpeg | branch: master | Nidhi Makhijani <nidhimj22 at gmail.com> | Fri May 23 19:30:02 2014 +0530| [8692e6284f5169257a537c8fc25addf32fc67c87] | committer: Anton Khirnov

rdt: check malloc calls

Signed-off-by: Anton Khirnov <anton at khirnov.net>

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

 libavformat/rdt.c |    8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/libavformat/rdt.c b/libavformat/rdt.c
index a90c168..304f4cf 100644
--- a/libavformat/rdt.c
+++ b/libavformat/rdt.c
@@ -399,6 +399,8 @@ rdt_parse_b64buf (unsigned int *target_len, const char *p)
     }
     *target_len = len * 3 / 4;
     target = av_mallocz(*target_len + FF_INPUT_BUFFER_PADDING_SIZE);
+    if (!target)
+        return NULL;
     av_base64_decode(target, p, *target_len);
     return target;
 }
@@ -521,8 +523,10 @@ static PayloadContext *
 rdt_new_context (void)
 {
     PayloadContext *rdt = av_mallocz(sizeof(PayloadContext));
-
-    int ret = avformat_open_input(&rdt->rmctx, "", &ff_rdt_demuxer, NULL);
+    int ret;
+    if (!rdt)
+        return NULL;
+    ret = avformat_open_input(&rdt->rmctx, "", &ff_rdt_demuxer, NULL);
     if (ret < 0) {
         av_free(rdt);
         return NULL;



More information about the ffmpeg-cvslog mailing list