summaryrefslogtreecommitdiff
path: root/libavformat/aviobuf.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/aviobuf.c
parent0f310a6f333b016d336674d086045e8473fdf918 (diff)
avformat: Use av_reallocp() where suitable
Signed-off-by: Diego Biurrun <diego@biurrun.de>
Diffstat (limited to 'libavformat/aviobuf.c')
-rw-r--r--libavformat/aviobuf.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/libavformat/aviobuf.c b/libavformat/aviobuf.c
index 2354f47fd2..7d76e0b1b0 100644
--- a/libavformat/aviobuf.c
+++ b/libavformat/aviobuf.c
@@ -879,9 +879,9 @@ static int dyn_buf_write(void *opaque, uint8_t *buf, int buf_size)
}
if (new_allocated_size > d->allocated_size) {
- d->buffer = av_realloc(d->buffer, new_allocated_size);
- if(d->buffer == NULL)
- return AVERROR(ENOMEM);
+ int err;
+ if ((err = av_reallocp(&d->buffer, new_allocated_size)) < 0)
+ return err;
d->allocated_size = new_allocated_size;
}
memcpy(d->buffer + d->pos, buf, buf_size);