[SCM] libav/experimental: rdt: check malloc calls

siretart at users.alioth.debian.org siretart at users.alioth.debian.org
Sun Aug 10 16:03:14 UTC 2014


The following commit has been merged in the experimental branch:
commit 8692e6284f5169257a537c8fc25addf32fc67c87
Author: Nidhi Makhijani <nidhimj22 at gmail.com>
Date:   Fri May 23 19:12:02 2014 +0530

    rdt: check malloc calls
    
    Signed-off-by: Anton Khirnov <anton at khirnov.net>

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;

-- 
Libav/FFmpeg packaging



More information about the pkg-multimedia-commits mailing list