diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-05-24 13:20:14 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-05-24 13:21:33 +0200 |
commit | 726316240bcc41cef6053dd6d1e46a3c57328498 (patch) | |
tree | 9f9c180540b718792d73c1f52633a4d392aa26a8 | |
parent | cba92a2226151abf0e3c24ed594e127203d485b8 (diff) | |
parent | 8692e6284f5169257a537c8fc25addf32fc67c87 (diff) | |
download | ffmpeg-726316240bcc41cef6053dd6d1e46a3c57328498.tar.gz |
Merge commit '8692e6284f5169257a537c8fc25addf32fc67c87'
* commit '8692e6284f5169257a537c8fc25addf32fc67c87':
rdt: check malloc calls
Merged-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavformat/rdt.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/libavformat/rdt.c b/libavformat/rdt.c index 201a3e0464..37fcd7603c 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; |