diff options
author | Nidhi Makhijani <nidhimj22@gmail.com> | 2014-05-23 19:12:02 +0530 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2014-05-24 07:51:12 +0200 |
commit | 8692e6284f5169257a537c8fc25addf32fc67c87 (patch) | |
tree | 88a2a457d353b10f455f8f167a1a93cba9f98bf1 /libavformat | |
parent | 21f68c2489cba2a1a4a41d0c5c828266e6162800 (diff) | |
download | ffmpeg-8692e6284f5169257a537c8fc25addf32fc67c87.tar.gz |
rdt: check malloc calls
Signed-off-by: Anton Khirnov <anton@khirnov.net>
Diffstat (limited to 'libavformat')
-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 a90c16849c..304f4cf210 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; |