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/rtpdec_asf.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'libavformat/rtpdec_asf.c') diff --git a/libavformat/rtpdec_asf.c b/libavformat/rtpdec_asf.c index e425650696..7c893af396 100644 --- a/libavformat/rtpdec_asf.c +++ b/libavformat/rtpdec_asf.c @@ -239,14 +239,11 @@ static int asfrtp_parse_packet(AVFormatContext *s, PayloadContext *asf, int cur_len = start_off + len_off - off; int prev_len = out_len; - void *newmem; out_len += cur_len; if (FFMIN(cur_len, len - off) < 0) return -1; - newmem = av_realloc(asf->buf, out_len); - if (!newmem) - return -1; - asf->buf = newmem; + if ((res = av_reallocp(&asf->buf, out_len)) < 0) + return res; memcpy(asf->buf + prev_len, buf + off, FFMIN(cur_len, len - off)); avio_skip(pb, cur_len); -- cgit v1.2.3