aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/rtmphttp.c
diff options
context:
space:
mode:
authorAlexandra Khirnova <alexandra.khirnova@gmail.com>2013-09-18 18:12:36 +0200
committerDiego Biurrun <diego@biurrun.de>2013-09-18 18:28:38 +0200
commit5626f994f273af80fb100d4743b963304de9e05c (patch)
tree69a48a5383a83d06f8e25df3098cce219788e873 /libavformat/rtmphttp.c
parent0f310a6f333b016d336674d086045e8473fdf918 (diff)
downloadffmpeg-5626f994f273af80fb100d4743b963304de9e05c.tar.gz
avformat: Use av_reallocp() where suitable
Signed-off-by: Diego Biurrun <diego@biurrun.de>
Diffstat (limited to 'libavformat/rtmphttp.c')
-rw-r--r--libavformat/rtmphttp.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/libavformat/rtmphttp.c b/libavformat/rtmphttp.c
index e67abba57c..5de1857a28 100644
--- a/libavformat/rtmphttp.c
+++ b/libavformat/rtmphttp.c
@@ -85,14 +85,12 @@ static int rtmp_http_send_cmd(URLContext *h, const char *cmd)
static int rtmp_http_write(URLContext *h, const uint8_t *buf, int size)
{
RTMP_HTTPContext *rt = h->priv_data;
- void *ptr;
if (rt->out_size + size > rt->out_capacity) {
+ int err;
rt->out_capacity = (rt->out_size + size) * 2;
- ptr = av_realloc(rt->out_data, rt->out_capacity);
- if (!ptr)
- return AVERROR(ENOMEM);
- rt->out_data = ptr;
+ if ((err = av_reallocp(&rt->out_data, rt->out_capacity)) < 0)
+ return err;
}
memcpy(rt->out_data + rt->out_size, buf, size);