diff options
author | Alexandra Khirnova <alexandra.khirnova@gmail.com> | 2013-09-18 20:12:36 +0400 |
---|---|---|
committer | Diego Biurrun <diego@biurrun.de> | 2013-09-18 20:28:38 +0400 |
commit | 5626f994f273af80fb100d4743b963304de9e05c (patch) | |
tree | 69a48a5383a83d06f8e25df3098cce219788e873 /libavformat/rtpdec_asf.c | |
parent | 0f310a6f333b016d336674d086045e8473fdf918 (diff) |
avformat: Use av_reallocp() where suitable
Signed-off-by: Diego Biurrun <diego@biurrun.de>
Diffstat (limited to 'libavformat/rtpdec_asf.c')
-rw-r--r-- | libavformat/rtpdec_asf.c | 7 |
1 files changed, 2 insertions, 5 deletions
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); |