From 5626f994f273af80fb100d4743b963304de9e05c Mon Sep 17 00:00:00 2001 From: Alexandra Khirnova Date: Wed, 18 Sep 2013 18:12:36 +0200 Subject: avformat: Use av_reallocp() where suitable Signed-off-by: Diego Biurrun --- libavformat/rtmphttp.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'libavformat/rtmphttp.c') 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); -- cgit v1.2.3